vbscript in template doesn't function as i'd expect :) (umb 4.0.3/iis 7.5)
Can someone tell me why litTime updates and litStatus doesn't when i click the button on the page? I suppose i've forgot some statement of some kind, but can't figure out whats wrong..
<%@ Master Language="VB" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %>
<asp:content ContentPlaceHolderId="Content" runat="server">
<script runat="server">
Sub btnSubmit_Click(sender As Object, e As System.EventArgs) Handles btnSubmit.Click
litStatus.Text = "Hello"
End Sub
Sub Page_Load()
litTime.Text = Now()
End Sub
</script>
<p><asp:literal id="litTime" runat="server" />
<asp:literal id="litStatus" runat="server" text="Untouched" /></p>
<table>
<tr>
<td>Name:</td><td><asp:textbox runat="server" id="txtName" /></td>
</tr>
<tr>
<td>Email:</td><td><asp:textbox runat="server" id="txtEmail" /></td>
</tr>
<tr><td></td><td><asp:button runat="server" id="btnSubmit" text="Send" /></td></tr>
</table>
</asp:content>
Worked it out... I had a second asp:button with the postbackurl property set to another page and that seems to have caused the problem.. Also i noticed that when postbackurl is set on any button the viewstate is broken...
vbscript in template doesn't function as i'd expect :) (umb 4.0.3/iis 7.5)
Can someone tell me why litTime updates and litStatus doesn't when i click the button on the page? I suppose i've forgot some statement of some kind, but can't figure out whats wrong..
Try adding OnClick="btnSubmit_Click" to your asp:button, and see what happens.
Didn't work, but shouldn't "Handles btnSubmit.Click" handle this?
Try to add
Friend WithEvents btnSubmit As System.Web.UI.WebControls.Button
Not sure but it may do the trick. Let me know how this change goes
Regards
Sam
BC30260: 'btnSubmit' is already declared as 'Protected Dim WithEvents btnSubmit As System.Web.UI.WebControls.Button' in this class.
So I guess it is declared already :(
Could it be that the form isn't being posted back because of some ajax-script?
The page can be seen at http://adrenalinkick.dk/test/kontakt
Worked it out... I had a second asp:button with the postbackurl property set to another page and that seems to have caused the problem.. Also i noticed that when postbackurl is set on any button the viewstate is broken...
But thanks for your replies anyway :)
Good to hear you managed to fix it. On my local machine was working ok and couldn't find the reason it wasn't for you..
is working on a reply...