|
Khan_Coder wrote: Hello Sandeep,
Did u work on my issue. Did u find out the source of error.
Why would he work on YOUR problem. Surely you should be working on your problem. The people here are only here to help when they can. Not to do other people's work for them.
|
|
|
|
|
Sorry Khan
I failed to find it out Actually i similar application its working fine
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Khan
i think this is not way to reply anyone ......
i tried my best and i don't know what you have done other than that you have shown
<l>Thanks and Regards
Sandeep
|
|
|
|
|
hi khan
may be you can better use the option to "delete post" or "alter it" to delete such messages posted by error..
sorry for interfering ...i hope it helps u in future...
Rama Charan Prasad
"Be happy and Keep smiling.Thats what u want be always.. "
|
|
|
|
|
hi...
how can i redirect to desired page after forms authentication is successful from the login page instead of redirecting to "default.aspx" which my application is redirecting to?
thanks for help in advance.
Rama Charan Prasad
"Be happy and Keep smiling.Thats what u want always.. "
|
|
|
|
|
i am not very experienced in ASP.NET but what i would do is put the redirecting code in the pageload event of the default.aspx page. so, when a user is redirected from the login page to the default.aspx page, the code can determine where to redirect the user according to the information stored in the authentication cookie.
hope this helps.;)
|
|
|
|
|
thnks for your help and also for trying.
thts a good suggestion.but i have solved it by changing my default page which should load after login to "default.aspx" so its working .
BUT I dont want to do like that but i want to know how can i redirect to specified page .
thnks for help in advance
Rama Charan Prasad
"Be happy and Keep smiling.Thats what u want be always.. "
|
|
|
|
|
for example you have a page called "abc.aspx" which user should do login here...ok?
you need another page called "def.aspx" to appear after the user have login.
So you need to define a bool variable forexample " check " ...
then set the check ( boolean ) with ur login statement ( checking user name and password ) ...then if the "check" is true then u need to have a code there to redirect to "def.aspx"
|
|
|
|
|
thnks for suggestion
sorry ,may be i am not clear or not able to understand what you explained me.
but as u know once we turn on the forms autenticaion as successful
FormsAuthentication.RedirectFromLoginPage(userid, True)
then it redirects to "default.aspx" so we have no chance to redirect to desired page using response.redirect or any other way.
can u please explan me clearly your logic or procedure ..you may write a dummy code if u wish
thnks a lot
Rama Charan Prasad
"Be happy and Keep smiling.Thats what u want be always.. "
|
|
|
|
|
if (txtuser.Text.Trim().Length>0 && txtpass.Text.Trim().Length>0 )<br />
{ <br />
<br />
bool Success;<br />
to check if the login is true or not . your dataset should return Success ( it meants " out,bool" )<br />
if(Success)<br />
{<br />
<br />
System.Web.HttpContext.Current.Response.Redirect("WebForm2.aspx");<br />
}
|
|
|
|
|
thanks for reply,
but its not working the reason i suppose is given below
you are using response.redirect() then you not saying that the forms authentication is successful to the server without using the function
FormsAuthentication.RedirectFromLoginPage(userid, True)
so the page redirection is not working
so please suggest me any other way if possible...
thank you
-- modified at 9:29 Wednesday 21st February, 2007
Rama Charan Prasad
"Be happy and Keep smiling.Thats what u want be always.. "
|
|
|
|
|
Am having problems with the following code.
File.Delete("images\logos\" + OldFileName)
The error details that the site is trying to delete to the folder "windows\system32\inetsrv\images\logos\" which is not the correct folder. I believe this is the directory that IIS runs in. How do I get to the local folder that the website and the images folder reside in?
Thanks
|
|
|
|
|
try this
File.Delete(Server.MapPath("images\logos\" + OldFileName));
<l>Thanks and Regards
Sandeep
|
|
|
|
|
hi,
can anyone explain if it is normal for the session variable to disappear after writing to a file. if yes what can i do (work around?) to make them persist even after writing to a file.
thanks.
|
|
|
|
|
No there is no reason why this should happen.
|
|
|
|
|
This should not happen
Might be session timeout or you are closing the session (unknownly)
Can you post the code What you have done while writing to file ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
here is the code:
when the user clicks the login button the following code gets executed:
Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click
' Attempt to Validate User Credentials using UsersDB from XML file
Dim accountSystem As New ProcessNowUser
if accountSystem.AuthenticateUser(txtUserID.Text, txtPassword.Text) Then
Session("UserID") = accountSystem.UserID
Session("DisplayName") = accountSystem.UserName
FormsAuthentication.RedirectFromLoginPage(accountSystem.UserName, False)
Else
Message.InnerText = "Sorry ! Login Failed. Please try again."
End If
End Sub
when the user clicks the change password button the function below is called and the new password is saved in the XML file. But when the page reloads the all session variables lose their value.
Private Sub btnChangePassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChangePassword.Click
If isPageValid() Then
Dim changePwd As New ProcessNowUser
Dim sResults As String = changePwd.ChangePassword(Session("DisplayName").ToString.Trim, txtCurrentPassword.Text.Trim, txtNewPassword.Text.Trim)
If sResults.Equals("No Password") Then
ShowMessage("Password doesnot match!", Me)
Else
ShowMessage("Password changed successfully!", Me)
End If
End If
End Sub
Public Function ChangePassword(ByVal userName As String, ByVal OldPassword As String, ByVal NewPassword As String) As String
Dim returnValue As String = ""
Dim dvUsers As DataView = _dsDataStore.Tables("Users").DefaultView
dvUsers.RowFilter = "username='" & userName & "'"
If dvUsers.Count > 0 Then
Dim sPublicKey As String = dvUsers(0)("key")
Dim sEncryptedPassword As String = dvUsers(0)("password")
Dim sDecryptedPassword As String = Utility.DecryptTripleDES(sEncryptedPassword, sPublicKey)
If sDecryptedPassword = OldPassword Then
dvUsers(0)("password") = Utility.EncryptTripleDES(NewPassword, sPublicKey)
dvUsers(0)("key") = sPublicKey
updatexmlOnly(_dsDataStore)
returnValue = "OK"
Else
returnValue = "No Password"
End If
Else
returnValue = "No User"
End If
Return returnValue
End Function
Private Sub updatexmlOnly(ByVal ds As DataSet)
If IO.File.Exists(_sTargetDirectory & XML_DATA_DIRECTORY & "adminuser.xml") Then
IO.File.Delete(_sTargetDirectory & XML_DATA_DIRECTORY & "adminuser.xml")
End If
ds.WriteXml(_sTargetDirectory & XML_DATA_DIRECTORY & "adminuser.xml")
End Sub
|
|
|
|
|
Is this process taking longer than the session timeout (default 20 minutes)?
Cleako
|
|
|
|
|
no, completes as soon as the button is clicked and the page reloads. but unfortunately, the session variables = Nothing
|
|
|
|
|
I'm really sorry for asking this as I'm sure it's something that has been solved many times before, but I must just not be using the right search terms to find the info.
I'm using ASP.NET 2.0 and C#. I'm using the treeview control and have it connected to a database and it works fine. It's kind of a FAQ page and the items in the treeview are links to an ID # of the topic that is passed to the page as an argument (page.aspx?id=3). The problem is that I can not figure out how to make the tree expand to the item. When the user visits the page, the menu is always collapsed. I would like to make the tree expanded to the item in the argument (id=3).
Hopefully I'm making sense.
TIA!
|
|
|
|
|
hi to all
i m working on asp.net 1.0 with crystal report 9
i create my report (.rpt) in crystal report 9 and it is working fine there.
Now the problem is how to add this report on form with parameters
pl. give some sample code OR URL
thanks in advance
john
|
|
|
|
|
|
thanks for reply BUT i m not using dataset, i wnat to include .rpt file in asp.net page with parameter
|
|
|
|
|
hello friends,
I need to purchase editable dropdownlist for my web applications when i type something the data should be selected in dropdownlist where can i find this any idea
regards jabbar
jabbarsb
|
|
|
|
|
use Autosuggest control using AJAX
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|