As I said before, you have to catch System.Threading.ThreadAbortException. ThreadAbortException is thrown exactly after you do a Response.Redirect. This is normal and it's because the .NET-Framework informs itself that the current thread is beeing aborted. Your problem was that you generally catch every type of exception. Instead you must catch the ThreadAbortException BEFORE you catch any other Exception types. Before you go on, take a look on the documentation of "System.Threading.ThreadAbortException", afterwards it will be clear why you get the message "Thread was being aborted." so change your code to this: Try 'call the ValidateLogin function If ValidateUser(txtLoginId.Value.ToUpper, txtPassword.Value.ToUpper) Then If Request.Params("ReturnUrl") <> "" Then FormsAuthentication.RedirectFromLoginPage(txtLoginId.Value, True) Else If iStatus = 1 Then Response.Redirect("EntrySubscriberDtls.aspx") Else Response.Redirect("ViewSubscriberDtls.aspx") End If End If Else Response.Redirect("VendorLogin.aspx", True) lblErrorMsg.Text = "Invalid UserName or Password" End If Catch ex as System.Threading.ThreadAbortException ' Do nothing here, just catch the exception Catch ex As Exception 'Throw error Message lblErrorMsg.Text = ex.Message End Try hope that helps - walter
Walter_H
Posts
-
FormsAuthentication -
FormsAuthenticationhi! your problem is the Server.Transfer method in both cases. you have to do a Response.Redirect(...) with the client so that he gets the auth-cookie. have a look at the differences of both methods in your VS-help. Make sure that you catch ThreabAbortException which is thrown by Response.Redirect. in your case: Private Sub imgbtnSubmit_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbtnSubmit.Click Try ... Catch exc as ThreadAbortException ' Do nothing here Catch ex As Exception 'Throw error Message txtLoginId.Value = "" txtPassword.Value = "" lblErrorMsg.Text = "Invalid Username or Password" End Try End Sub -walter
-
http://path/[Username] - Virtual Directory?try googling 'URL Rewriting'. i think this is exactly what you need. - walter
-
Retrieving Full URL from a relative urlHttpContext.Current.Request.Url.AbsoluteUri - walter
-
authenticationHave a look at the documentation of HttpContext.SkipAuthorization property. - walter
-
XML using XSLHi Feroze! Why aren't you using the XML-Control (found in the Toolbox)? With this you just need to apply the XML-Source and the transformation file. e.g: Dim xmlDoc As New XmlDocument() xmlDoc.Load("your path to the xml-data goes here") With yourXmlControl .Document = xmlDoc .TransformSource = "your path to the xsl-file goes here" End with This is all what needs to be done. - walter
-
help requiredtry this: it will find all HTML comments within the source. greetings walter
-
Right Click Disable -
Count String Relpacements using Replace Functionbefore doing the replacement you could use RegEx.Matches(InputString,SearchPattern).Count. BTW: RegEx.Replace is also a good method to do string-replacements. - walter
-
database problem in vb.netyour're right! sorry - walter
-
update data from datagrid using ado in vb.netcan be easily found in the MSDN! everything can be done by using the DataAdapter. example from MSDN: ' Assumes connection is a valid SqlConnection. Dim adapter As SqlDataAdapter = New SqlDataAdapter( _ "SELECT CategoryID, CategoryName FROM Categories", connection) adapter.UpdateCommand = New SqlCommand( _ "UPDATE Categories SET CategoryName = @CategoryName " & _ "WHERE CategoryID = @CategoryID", connection) adapter.UpdateCommand.Parameters.Add( _ "@CategoryName", SqlDbType.NVarChar, 15, "CategoryName") Dim parameter As SqlParameter = adapter.UpdateCommand.Parameters.Add( _ "@CategoryID", SqlDbType.Int) parameter.SourceColumn = "CategoryID" parameter.SourceVersion = DataRowVersion.Original Dim dataSet As DataSet = New DataSet adapter.Fill(dataSet, "Categories") Dim row As DataRow = dataSet.Tables("Categories").Rows(0) row("CategoryName") = "New Category" adapter.Update(dataSet, "Categories") -walter
-
Object variable or With block variable not set.i think it would be much more easier if you wrote a class that holds the data and put cllas-instances into an ArrayList: ' The class that holds the data class mydata public StringValue as string public IntValue as integer public BoolValue as Boolean end class ' Your Function Spot Function Spot() As ArrayList Dim ObjArray As New ArrayList() Dim clsInstance1 As New mydata Dim clsInstance2 As New mydata With clsInstance1 .StringValue = "Hello World" .IntValue = 69 .BoolValue = False End With With clsInstance2 .StringValue = "Hello Again" .IntValue = 96 .BoolValue = True End With ObjArray.Add(clsInstance1) ObjArray.Add(clsInstance2) Return ObjArray End Function ' in your Button-Click: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click Dim arrList as ArrayList = Spot() MsgBox(arrList(1).IntValue.ToString()) End Sub - walter
-
database problem in vb.netyou can do this by querying the DataSet's table-Collection with the method Contains. e.g: Dim ds As New DataSet ... If ds.Tables.Contains("YourTableName") Then ... End If - walter
-
How Redirecting Page to same...by pressing enter normally the default-control's event is fired. i.e if you have a submit-button on your site then probably this one is pressed. -walter
-
Weird Issue with IF Statementif you want to compare two date-values you shouldn't cast them to strings. use the DateTime.Compare or DateTime.CompareTo methods instead. i.e if(dayDate.CompareTo(DateTime.Parse(Request.QueryString("enddate")) == 0) { // do something here, if the dates are equal } else { ... } - walter
-
Newline in regular expression validation...well...;) there's probably a problem with the view-state in your site, i don't know. maybe you'll find these links helpful: RegExLib[^] and RegEx-Coach[^] for testing your regular expressions. good luck walter
-
Newline in regular expression validation...try this one: ([0-9a-zA-Z _\+-\.\*\(\)&#%':!\n"])+ hope that helps walter
-
Newline in regular expression validation...what exactly do you want to validate? give me an example of the validated text and the rules you want to apply walter
-
Moving The Mouse/Cursor Then Button Click ?i guess the right way would be the SendMessage function. use it with the parameter WM_LBUTTONUP. walter
-
Newline in regular expression validation...have you tried to remove the "^" and "$" characters?these specify the beginning("^") and the end("$") of a line.so it makes no sense if "\n" is placed between these two. walter