Click here to Skip to main content
16,005,169 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionFileDownload Control Pin
#realJSOP15-Oct-08 12:39
professional#realJSOP15-Oct-08 12:39 
AnswerRe: FileDownload Control Pin
Steve Echols15-Oct-08 17:26
Steve Echols15-Oct-08 17:26 
QuestionAsp.net Pin
rock_mre15-Oct-08 12:16
rock_mre15-Oct-08 12:16 
AnswerRe: Asp.net Pin
Caio Kinzel Filho15-Oct-08 12:43
Caio Kinzel Filho15-Oct-08 12:43 
QuestioncssFriendly problems Pin
TheEagle15-Oct-08 11:18
TheEagle15-Oct-08 11:18 
QuestionHow can i declare a webcontrol in a webservice? Pin
Cannery15-Oct-08 9:00
Cannery15-Oct-08 9:00 
AnswerRe: How can i declare a webcontrol in a webservice? Pin
Steve Echols15-Oct-08 17:40
Steve Echols15-Oct-08 17:40 
QuestionProblem with GridView Pin
Enayat Ashkian15-Oct-08 8:12
Enayat Ashkian15-Oct-08 8:12 
Hi, have a look at the following code:
aspx file
###
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView AutoGenerateColumns="false" ID="grdNoFlashInstances" Runat="server">
		<Columns><asp:TemplateField ShowHeader="False"><ItemTemplate>
            <GL:ItemWI ID="AloneItem" Width="170" runat="server" 
                CornerLeftTopImagePath="../App_Themes/Images/Item_Corner_Left.gif" 
                CenterTopImagePath="../App_Themes/Images/Item_Line.gif" 
                CornerRightTopImagePath="../App_Themes/Images/Item_Corner_Right.gif" 
                CornerLeftMiddleImagePath="../App_Themes/Images/Item_vertical.gif" 
                CenterMiddleBackgroundPath="../App_Themes/Images/Item_bg.gif" 
                CenterMiddleImagePath='<%#DataBinder.Eval(Container.DataItem, "ImageName") %>' 
                CornerLeftButtomImagePath="../App_Themes/Images/Item_Square2.gif" 
                CenterButtomImagePath="../App_Themes/Images/Item_Line.gif" 
                CornerRightButtomImagePath="../App_Themes/Images/Item_Square.gif.gif" 
                FooterLeftImagePath="../App_Themes/Images/Item_bttnleft.gif" 
                FooterMiddleBackgroundPath="../App_Themes/Images/Item_Header.gif" 
                NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "WebAddress") %>' 
                FooterMiddleText='<%# DataBinder.Eval(Container.DataItem, "Title") %>' />
        </ItemTemplate></asp:TemplateField></Columns>
    </asp:GridView>
    </div>
    </form>
</body>


###
code behind file:

###
protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
        if (!Page.IsPostBack)<br />
        {<br />
            string prePath = ConfigurationManager.AppSettings["ImageBase"].ToString();<br />
            string preWIPath = ConfigurationManager.AppSettings["ImageBase"].ToString() + ConfigurationManager.AppSettings["ImageBase_WorkInstances"].ToString();<br />
            WorkInstance workInstance = new WorkInstance();<br />
            SqlDataReader dr;<br />
            dr = workInstance.GetNotFlashItems();<br />
            //If result has any record?<br />
            if (dr.HasRows)<br />
            {<br />
                alone<br />
                grdNoFlashInstances.DataSource = dr;<br />
                grdNoFlashInstances.DataBind();<br />
            }<br />
            dr.Close();<br />
        }<br />
    }

###
setting the property "CenterMiddleImagePath":
How should it be?
Answer: the saved value in database is just the filename. but path of the files should be retrieved from the file web.config and set to the variable prepath as the following. so the value of the above property is preWIPath + DataBinder.Eval(Container.DataItem, "ImageName")

string prePath = ConfigurationManager.AppSettings["ImageBase"].ToString();
string preWIPath = ConfigurationManager.AppSettings["ImageBase"].ToString() + ConfigurationManager.AppSettings["ImageBase_WorkInstances"].ToString();

QUESTION:How do I format the code in the source of the aspx file to setting the above property as said?

Trying other way:I wanted to setting the above the property in the code (.cs) file, but it say the The name 'AloneItem' does not exist in the current context?!!!

Question:How can I do it from the code file?
QuestionCustom Contols Within Other Custom Controls Pin
Mateobus15-Oct-08 7:08
Mateobus15-Oct-08 7:08 
QuestionProblem With Update Panel Pin
pinna_hari15-Oct-08 6:56
pinna_hari15-Oct-08 6:56 
AnswerRe: Problem With Update Panel Pin
AlexeiXX315-Oct-08 7:39
AlexeiXX315-Oct-08 7:39 
QuestionDeploying a asp.net 2.0 web application Pin
SUDHAKAR PALLAM15-Oct-08 5:45
SUDHAKAR PALLAM15-Oct-08 5:45 
AnswerRe: Deploying a asp.net 2.0 web application Pin
AlexeiXX315-Oct-08 7:42
AlexeiXX315-Oct-08 7:42 
GeneralRe: Deploying a asp.net 2.0 web application Pin
SUDHAKAR PALLAM15-Oct-08 20:31
SUDHAKAR PALLAM15-Oct-08 20:31 
QuestionApplying a custom theme (skin) to a GridView Pin
Steve Holdorf15-Oct-08 5:44
Steve Holdorf15-Oct-08 5:44 
AnswerRe: Applying a custom theme (skin) to a GridView Pin
AlexeiXX315-Oct-08 7:48
AlexeiXX315-Oct-08 7:48 
GeneralRe: Applying a custom theme (skin) to a GridView Pin
Steve Holdorf15-Oct-08 8:14
Steve Holdorf15-Oct-08 8:14 
GeneralRe: Applying a custom theme (skin) to a GridView Pin
AlexeiXX315-Oct-08 8:17
AlexeiXX315-Oct-08 8:17 
GeneralRe: Applying a custom theme (skin) to a GridView Pin
AlexeiXX315-Oct-08 8:29
AlexeiXX315-Oct-08 8:29 
GeneralRe: Applying a custom theme (skin) to a GridView Pin
Steve Holdorf15-Oct-08 17:38
Steve Holdorf15-Oct-08 17:38 
GeneralRe: Applying a custom theme (skin) to a GridView Pin
AlexeiXX315-Oct-08 18:07
AlexeiXX315-Oct-08 18:07 
GeneralRe: Applying a custom theme (skin) to a GridView Pin
Steve Holdorf16-Oct-08 3:47
Steve Holdorf16-Oct-08 3:47 
Questionreadxml and timezone Pin
ed james15-Oct-08 5:29
ed james15-Oct-08 5:29 
QuestionThemes and Skins tutorial Pin
Steve Holdorf15-Oct-08 5:28
Steve Holdorf15-Oct-08 5:28 
AnswerRe: Themes and Skins tutorial Pin
ed james15-Oct-08 5:35
ed james15-Oct-08 5:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.