|
|
I've set it at Page_Init and it works great
10x
|
|
|
|
|
you can just set this on the aspx page at the top in the declaration this might be a little easier.
Three types of people in this world, those that can count and those that can't
www.casserlyprogramming.com
|
|
|
|
|
I have a contact.aspx page
I created asp:table with rows which has txtMessage, txtEmail and btnSend controls
I placed the table within asp:updatepanel and above it I have asp:updateprogress
Now ajax seems to be working properly and updateprogress is showing
I only have one problem here
In the btnSend_Click evet, I am setting ther button enable to false which is not happening!
I also tried setting the entire table visibility to false but its not happening as well
I am not getting any error and submission is going through but without doing what I want with the button enable property
What can I do plz?
|
|
|
|
|
It should not happen. I tried and its working fine as expected.Can you post code.. Then it'll be better to answer.
|
|
|
|
|
This is the code. I just need to disable the btnSend or any of the textbox
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="panelContact" runat="server">
<ContentTemplate>
<div>
<asp:Table ID="Table11" runat="server" CellPadding="10">
<asp:TableRow ID="rowComment"><asp:TableCell VerticalAlign="Top" ColumnSpan="3"><asp:Label runat="server" ID="lblStatus" Text="Thank you." ForeColor="Red" Font-Bold="true" Visible="false" /><asp:Label runat="server" ID="lblMessage" Text="Please write your message and I will get back to you as soon as possible." /></asp:TableCell></asp:TableRow>
<asp:TableRow ID="rowHomePage" Visible="false"><asp:TableCell VerticalAlign="Top" ColumnSpan="3"><br /><asp:HyperLink ID="lblHomePage" runat="server" Text="Click Here to return to home page." NavigateUrl="Default.aspx" /></asp:TableCell></asp:TableRow>
<asp:TableRow ID="rowMessage">
<asp:TableCell VerticalAlign="Top">Your Message</asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top">:</asp:TableCell>
<asp:TableCell VerticalAlign="Top"><asp:TextBox runat="server" ID="txtMessage" TextMode="MultiLine" TabIndex="0" Width="300px" Height="150px"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="rowEmail">
<asp:TableCell VerticalAlign="Top">Your Email</asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top">:</asp:TableCell>
<asp:TableCell VerticalAlign="Top" HorizontalAlign="Right"><asp:TextBox runat="server" ID="txtEmail" Width="300px"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="rowbutton">
<asp:TableCell VerticalAlign="Top"></asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top"></asp:TableCell>
<asp:TableCell VerticalAlign="Top">
<asp:UpdateProgress runat="server" ID="updateProgress" DisplayAfter="1">
<ProgressTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/loading_progress.gif" />
</ProgressTemplate>
</asp:UpdateProgress>
<asp:Button runat="server" ID="btnSend" Text="Send" Width="100%" OnClick="btnSend_Click" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
|
|
|
|
|
Perhaps the snippet was not posted or formatted correctly but you appear to have the both the progress control and the button inside the update panel
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes true
Why? Is it wrong?
So how can I do it?
|
|
|
|
|
The progress control should not be inside the update panel. See the example here[^] and while your at it read the rest of the documentation about UpdatePanels and how to use them.
Move the button outside the update panel and use a Trigger. Once again, reading the documentation will help.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thx for your replies
I noted your comments and changed my code accordingly but the button is not not allowing disable
Anyhow I have another question here please
How can I hide the UpdatePanel and all everything inside it when UpdateProgress is started?
And how can I show it back from the code if my try...returned error?
This my latest code
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="panelContact" runat="server">
<ContentTemplate>
<asp:Table ID="Table11" runat="server" CellPadding="10">
<asp:TableRow ID="rowComment"><asp:TableCell VerticalAlign="Top" ColumnSpan="3"><asp:Label runat="server" ID="lblStatus" Text="Thank you." ForeColor="Red" Font-Bold="true" Visible="false" /><asp:Label runat="server" ID="lblMessage" Text="Please write your message and I will get back to you as soon as possible." /></asp:TableCell></asp:TableRow>
<asp:TableRow ID="rowHomePage" Visible="false"><asp:TableCell VerticalAlign="Top" ColumnSpan="3"><br /><asp:HyperLink ID="lblHomePage" runat="server" Text="Click Here to return to home page." NavigateUrl="Default.aspx" /></asp:TableCell></asp:TableRow>
<asp:TableRow ID="rowMessage">
<asp:TableCell VerticalAlign="Top">Your Message</asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top">:</asp:TableCell>
<asp:TableCell VerticalAlign="Top"><asp:TextBox runat="server" ID="txtMessage" TextMode="MultiLine" TabIndex="0" Width="300px" Height="150px"></asp:TextBox></asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top"><asp:RequiredFieldValidator runat="server" ID="rgMessages" ControlToValidate="txtMessage" ToolTip="Please write your message!" Text='<img src="images/error.gif">' Display="Dynamic" SetFocusOnError="true" /></asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="rowEmail">
<asp:TableCell VerticalAlign="Top">Your Email</asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top">:</asp:TableCell>
<asp:TableCell VerticalAlign="Top" HorizontalAlign="Right"><asp:TextBox runat="server" ID="txtEmail" Width="300px"></asp:TextBox></asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top"><asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="txtEmail" ToolTip="Please enter a valid email address!" Text='<img src="images/error.gif">' Display="Dynamic" SetFocusOnError="true" /><asp:RegularExpressionValidator runat="server" ID="rgEmail" ControlToValidate="txtEmail" ToolTip="Please enter a valid email address!" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ErrorMessage='<img src="../images/error.gif">' Display="Dynamic" SetFocusOnError="true" /></asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="rowbutton">
<asp:TableCell VerticalAlign="Top"></asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top"></asp:TableCell>
<asp:TableCell VerticalAlign="Top">
<asp:Button runat="server" ID="btnSend" Text="Send" Width="100%" OnClick="btnSend_Click" />
</asp:TableCell>
<asp:TableCell Width="10" HorizontalAlign="Center" VerticalAlign="Top"></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSend" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress runat="server" ID="updateProgress" DisplayAfter="1" AssociatedUpdatePanelID="panelContact">
<ProgressTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/loading_progress.gif" />
</ProgressTemplate>
</asp:UpdateProgress>
Thanks
|
|
|
|
|
hi,
I've to play a mp3 file on my web page
how can i implement it
|
|
|
|
|
|
<audio controls autobuffer>
<source src="myfile.ogg" />
<source src="myfile.mp3" />
<!-- flash fall back if you care about ie -->
</audio>
http://html5doctor.com/native-audio-in-the-browser/
|
|
|
|
|
|
Hi,
I've asp.net 2.0 ajax enabled web site in which I used Ajax update panels in pages. Now I want to convert it into asp.net 3.5 but it gives errors for Ajax tool kit and script manager and update panel used in pages.
I don't want to remove ajax functionality from my site, so is there a way to convert them without removing ajax update panels from pages.
On my PC I've installed both VS2005 and VS2008.
Any suggestions is appreciated.
Thank
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
The Version of Ajax used in 2.0 and 3.5 is different. Your web config is still linked to the 2.0, so what you can do is remove remove the dll(ajaxtoolkit) in the bin and drag and drop any control in your page and it will create the dll in the bin directory and register it in the web config and start removing the 2.0 entries in the web config and you will see at the top of your page the 2.0 and 3.5 registration is not the same, try to change.
Hope this helps
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi All,
Is there a way to do this: if a request is from a manual item, then re-fetch the data from database, and if a request is from the other web controls, say link button, then do not re-fetch data from database.
Thanks very much.
|
|
|
|
|
I guess you could use __EVENTTARGET to identify the control that caused the post-back. i.e. the control that sent the current request.
http://forums.asp.net/t/1352215.aspx[^]
Cheers,
Karthik
|
|
|
|
|
Thanks very much for your reply, and you did point me in the right direction
Here is the trick:
Request.Params["__EVENTTARGET"].contains("xx");
xx is the control name (it's obficates, but still humna readable, such as: ctl00$AccordionMenu1$ctl15$clb0). the "AccordionMenu1" is the name of a user control, but u can but the other controls too, e.g. link button etc.
|
|
|
|
|
Great, you are welcome!
And, hopefully you might know this, just in case, you could get this value "ctl00$AccordionMenu1$ctl15$clb0" using <accordion_id>.ClientID (AccordionMenu1.ClientID in code-behind) in the server side or using '<%= AccordionMenu1.ClientID %>' (for use in javascript)
Cheers,
Karthik
|
|
|
|
|
If you are using postbacks, the simple way is to inspect the sender variable in your event handler. This identifies the control that actually triggered the postback. It really is that simple.
|
|
|
|
|
Hi,
i have a question regarding saving the page. Lets suppose i have one page whose contents change each time i refresh or open. Now lets say at one page, i want to save that page or I want to put that page in my favorites so that when i click that favorites link next time, it should show that saved content not the different one. Is it possible ? If yes, any idea how to make that happen ?
suchita
|
|
|
|
|
Usinng Browser's save and saving the webpage on your system hard disk is the only way to have same content again at later stage. Since the page changes everytime, you cannot persists to it's old state without saving it. You dont have control over it.
|
|
|
|
|
You are probably correct, but not necessarily so. Depending on how the page is created, it may be possible to construct a "Permalink" button which will re-load it with an amended URL (probably including some paramters) which allow the same page to be re-created again from that (bookmarkable) URL.
|
|
|
|
|
Thanks all. Just curious about that.
suchita
|
|
|
|