Ajax, ASP.NET question

L

laziers

Hi,
I have a question

this is very simple code:

<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></
asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button"
onclick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>

</div>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</form>

everything is fine, but is there any way to "call" the ajax using <a
href="">button</a> instend of clicking on the button control?

bye
 
G

Guest

Hi,
I have a question

this is very simple code:

 <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Label ID="Label1" runat="server" Text="Label"></
asp:Label>
                <asp:Button ID="Button1" runat="server" Text="Button"
onclick="Button1_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>

    </div>
    <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
    </form>

everything is fine, but is there any way to "call" the ajax using <a
href="">button</a> instend of clicking on the button control?

bye

Do you mean you don't want to do a postback, or you want to change a
look of the submit control? If you would add a LinkButton control
instead of the Button, you will see that the output you're getting on
the client is something about <a href="__doPostBack.... which would
trigger a partial postback of the UpdatePanel

Check this link
http://encosia.com/2007/07/13/easily-refresh-an-updatepanel-using-javascript/
 
L

laziers

Do you mean you don't want to do a postback, or you want to change a
look of the submit control?
yes
If you would add a LinkButton control
instead of the Button, you will see that the output you're getting on
the client is something about <a href="__doPostBack.... which would
trigger a partial postback of the UpdatePanel

Check this linkhttp://encosia.com/2007/07/13/easily-refresh-an-updatepanel-using-jav...

ok, thx for answare, that helped me :)

bye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top