PDA

View Full Version : Ajaxevent Request failure



lisaloomh
Feb 04, 2010, 12:23 AM
Hi,






Can someone help me pleaseee ..... i am lost ....
i am a coolite newbie. Sometimes i encounter request failure when submit a ajaxevent while sometimes i submit it successfully.
I am not sure if i am doing it correctly. Heres my sample codes and screen shots.


<U>Screetshots:</U>


http://nanodemo.co.cc/lisa/interface%20error.doc


<U>Full Code:</U>


http://nanodemo.co.cc/lisa/index.txt


<U>Sample code :</U>






<ext:Window
ID="loginwin"
runat="server"
Closable="false"
Resizable="false"
Height="150"
Icon="Lock"
Title="Login"
Draggable="false"
Width="350"
Modal="true"
Show&#111;nload=FALSE
BodyStyle="padding:5px;">
<Body>
<ext:FormLayout ID="FormLayout1" runat="server">
<ext:Anchor Horizontal="100%">
<ext:TextField ID="txtUsername" runat="server" FieldLabel="Username"
AllowBlank="false" BlankText="Your username is required." EmptyText="RXXXXX"
Regex="^[Rr]\d{5}$" StyleSpec="text-transform:uppercase" InvalidText="Wrong format!"/>
</ext:Anchor>
<ext:Anchor Horizontal="100%">
<ext:TextField ID="txtPassword" runat="server" InputType="Password"
FieldLabel="Password" AllowBlank="false" BlankText="Your password is required."
/>
</ext:Anchor>
</ext:FormLayout>
</Body>
<Buttons>
<ext:Button ID="login" runat="server" Text="Login" Icon="Accept">
<AjaxEvents>
<Click OnEvent="login_Click" Buffer="1000" Delay ="250">
<ExtraParams>
<ext:Parameter Name="userid" Value="#{txtUsername}.getValue()" Mode="Raw" />
<ext:Parameter Name="password" Value="#{txtPassword}.getValue()" Mode="Raw" />
</ExtraParams>
<EventMask ShowMask="true" Msg="Verifying..." MinDelay="1000" />
</Click>
</AjaxEvents>
</ext:Button>
</Buttons>
</ext:Window>









Protected Sub login_Click(ByVal sender As Object, ByVal e As AjaxEventArgs)


Dim param As Coolite.Ext.Web.ParameterCollection = e.ExtraParams


Dim userid As String = UCase(param("userid").ToString)


Dim password As String = param("password").ToString


If Trim(userid) = "" Or authenticate(userid, password) = False Then


Ext.Msg.Alert("Login Failure!", "Invalid Username or password!").Show()


Else


PMUSER.getEmployee(userid)


Session("userid") = userid


loginwin.Close()


End If


End Sub





Thanks


Lisa

lisaloomh
Feb 04, 2010, 10:11 PM
Can someone help i am lost ;)

r_honey
Feb 05, 2010, 6:13 AM
This line seems to be the problem:



Ext.Msg.Alert("Login Failure!", "Invalid Username or password!").Show()



Try this instead:



Ext.Msg.Alert("Login Failure!", "Invalid Username or password!")


Also, check in VS there are no syntax errors in your VB code inside [script> attribute.