Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Monday, March 26, 2012

ListSearchExtender Prompttext

Hi,

I'm using the ListSearchExtender in an intranet application. The application needs to be multilanguage, so I set the prompttext in the codebehind to a string in my resource files. But then, the application needs about 20 seconds for loading. Without setting the prompttext, it's done in 3 seconds.

I'm using this code:

ListSearchExtender1.PromptText = GetLocalResourceObject("LSEPromptText").ToString();

Has anyone an idea what to do?

Regards

Flo

why don't you set it in the aspx page by adding

meta:resourcekey="ListSearchExtender1Resource1"

to the list search extender's properties and then in the resource file add an entry key for

ListSearchExtender1Resource1.PromptText

then set the value to whatever you want it to be. That's what I did and it loads normally for all languages.


I have no idea why I didn't it that way. I used it in other applications... But thanks for the hint, it works.

Saturday, March 24, 2012

Load ascx in other Page using Ajax

I have one application, which has one Home.aspx, Head.Ascx and Footer.Ascx, Head.aspx has two button, And all controls of head.ascx and footer.ascx in ajax panel, now in home page when i click on one button then i want to load head.ascx in my Home page and if i click on second button then i want to load footer.aspx in Home page and unload Head.ascx. I am using ajax in my application. But not enable to solve this.

Thanks

Hi,

Here is an example made according to your requirement:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void btnHeader_Click(object sender, EventArgs e) { ViewState["show"] = "h"; } protected void btnFooter_Click(object sender, EventArgs e) { ViewState["show"] = "f"; } protected void Page_PreRender(object sender, EventArgs e) { if (ViewState["show"] != null) { string show = ViewState["show"].ToString(); if (show == "h") { Control ctrl = this.LoadControl("Header.ascx"); PlaceHolder1.Controls.Add(ctrl); } else { Control ctrl = this.LoadControl("Footer.ascx"); PlaceHolder1.Controls.Add(ctrl); } } }</script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Button ID="btnHeader" runat="server" Text="Show Header" onclick="btnHeader_Click" /> <asp:Button ID="btnFooter" runat="server" Text="Show Footer" onclick="btnFooter_Click" /> <asp:Button ID="Button3" runat="server" Text="Another Button" /> <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> </ContentTemplate> </asp:UpdatePanel> </div> </form></body></html>

Thanks Raymond Wen , it solved

Wednesday, March 21, 2012

LoadControl issue with UpdatePanel ?

Hi,

I have a very strange problem. I'm trying to decrease traffic on a web application. To do so, i'm adding some UpdatePanel in some user controls of our app.
No problem with the first controls i modified. I had the behaviour not modified while trafic was much better.

But i have a problem with the last control. I added some update panels on it (more than with the others). Finally, there are 14 Update panels in my user control (may be one of the most complicated in this application). The user control is loaded dynamically (using LoadControl), and it worked without problem before i added the update panels. After that, the LoadControl doesn't even call the OnInit() event, and directly goes to the CreateChildControls (where the controls are not then initialized.

I have found no information about such a problem. Does anyone have information about this kind of problem ? Is there a known issue on UpdatePanel about this?

thanks for your help.
Guillaume

Hi,

I think this is an old question,It is something about Dynamicaly loading User Controls into UpdatePanel.

You can see the following threads too:

http://forums.asp.net/p/1156704/1906671.aspx#1906671

http://forums.asp.net/t/1108394.aspx

Best Regards,


Thanks for your answer.

Unfortunately, this is not where my problem is. I repeat that i have my original control, already dynamically loaded, wich works fine.

This is only after adding all update panels (I know this is too much, but i do what i can with what i have) that controls inside my dynamically added control are not initialized (variables are null) and the first event called on the control is CreateChildControls... Any idea about the source of my problem? For me, it's like if there were a limit number of UpdatePanel... but it may be something else. I have no idea and found no resource on this problem (that's why i posted)...

Thanks


Hi,

If you dynamically add your usercontorl into an updatepanel, the issue comes.

Good luck!


See this

http://geekswithblogs.net/rashid/archive/2007/08/11/Loading-UserControl-Dynamically-in-UpdatePanel.aspx


Thanks for your answers. I finally managed to do what i wanted. The issue seems to be due to the use of Triggers. When i removed the triggers (and made the work programmaticaly), it fell working :).

I think there's a problem with triggers though :(.