Ajax, ASP.NET question

  • Thread starter Thread starter laziers
  • Start date Start date
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
 
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/
 
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
 
Back
Top