|
Sorry, i was a bit out.
I did a check on FormsAuthentication.CookiesSupported and it says true (i logged it to a file)
So i am a bit clueless here why this is happening.
webconfig:
<br />
<system.web><br />
<sessionState timeout="60"/><br />
</system.web><br />
<br />
<system.web><br />
<authentication mode="Forms"><br />
<forms path="BackOffice" loginUrl="BackOffice/Default.aspx?state=Timeout" defaultUrl="BackOffice/Home.aspx" timeout="55" cookieless="UseCookies"><br />
</forms><br />
</authentication><br />
<authorization><br />
<!--<allow users="*"/>--><br />
<deny users="?"/><br />
</authorization><br />
</system.web><br />
The validation code:
Protected Sub btnValidate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnValidate.Click<br />
Dim dt As DataTable = db.GetData("SELECT Active FROM tblUsers WHERE Email = '" & tbxEmail.Text.Trim & "' and Password = '" & Replace(tbxPassword.Text, "'", "''") & "'")<br />
<br />
If (dt.Rows.Count = 0) Then<br />
' This means that the combination of the email address and the password could not be found in the database<br />
lblLoginMessage.Text = CType(ViewState("vsAlerts"), Hashtable)("Alert1").ToString<br />
Else<br />
If (CType(dt.Rows(0)(0), Int32) = 0) Then<br />
' This means that the user is not allowed to log in, the Active bit is set to 0<br />
lblLoginMessage.Text = CType(ViewState("vsAlerts"), Hashtable)("Alert2").ToString<br />
Else<br />
Session.Add("User", tbxEmail.Text.Trim)<br />
Session.Add("Date", DateTime.Now.ToString)<br />
Session.Add("Active", 1)<br />
<br />
Common.LogInfo("FormsAuthentication.CookiesSupported: " & FormsAuthentication.CookiesSupported(), 3, Parameters.LOG_FILE, "clssDbAccess.SetData")<br />
<br />
FormsAuthentication.RedirectFromLoginPage(tbxEmail.Text.Trim, False)<br />
End If<br />
End If<br />
End Sub
|
|
|
|
|
can anyone please give me an idea how to insert new records from a gridview control by using a button having text ADD in the header
sudha
|
|
|
|
|
sudhadotnet wrote: can anyone please give me an idea how to
Ever heard of MSDN?[^]
led mike
|
|
|
|
|
Hi, Sorry if this is asked already,
I am doing...
button_Click(...)<br />
{<br />
literal1.Text="<iframe src="../Forms/NEW_Forms/MyForm.aspx" width="100%" height="100%"></iframe>";<br />
}
This works fine on my local machine wen I run is from VS
I cannot get the page when I put this on a local server, Should I change the URL in any way?
I tried using
literal1.Text="<iframe src="~/Forms/NEW_Forms/MyForm.aspx" width="100%" height="100%</iframe">";</iframe>
But no result,
This one is real easy for you guys, Please help.
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
check that the path for the folder is exactly the same as above, also try specifiying the full path and see if that works
|
|
|
|
|
Hi,
try the below code, hey but i m not sure its working..but let see
button_Click(...)
{
literal1.Text="<iframe src="./Forms/NEW_Forms/MyForm.aspx" width="100%" height="100%"></iframe>";
}
If above code is not working then try using Server.MapPath("MyForm.aspx")
I hope it will help u..
Regards,
Rana Krishnraj
|
|
|
|
|
hi all,
i am developing a content management system in asp.net with C#. i have a master page named "Master1.master" with 5 content place holders-"cphHeader, cphLeft,cphCenter,cphright,cphbottom". i have another default.aspx page which is inherited from the "Master1.master". it takes as input,the following fields from the user :
1. text to be displayed.(Textbox)
2. Content holder where the text will be displayed (dropdown having names of all the 5 content holders mentioned above.).
these things entered by the user are stored in the database. The text entered by the user should be displayed in the content holder mentioned above.
How do i do it?? is there any facility which helps us access the content place holders on the default.aspx.cs page.
thanks in advance.please reply as soon as possible.
|
|
|
|
|
You can add it to the CPH Control's collection:
ContentPlaceHolder cph = (ContentPlaceHolder)Master.FindControl("PrimaryContent");<br />
if (cph != null)<br />
cph.Controls.Add(new LiteralControl("The text string"));
|
|
|
|
|
Im not too sure on this but would you be able to put the content holders in a global or common methods page, this way you can acces them from any page.
|
|
|
|
|
Hi guys,
Please forgive me, if it is a question frequent asked.
As you know, when we tried to submit a asp.net page with characters something like '<test>' filled in, and we would get an error as the subject.
How can the exception "A potentially dangerous Request.Form value was detected from the client" be handled without setting the validateRequest to false in the page directive or in the web.config file? because I just want to void this ASP.NET feature for only a single textbox, Any suggestions?
Thanks, Ming.
modified on Wednesday, April 2, 2008 10:28 AM
|
|
|
|
|
Set ValidateRequest=false on the page.
|
|
|
|
|
Hi N a v a n e e t h,
Thanks for your solution, but I think you don't understand what I am asking, you are alright, that is my fault, I didn't hightlight the key words.
The key word is without setting the validateRequest to false in the page directive or in the web.config file?
Cheers,
Ming
|
|
|
|
|
Bluebamboo wrote: The key word is without setting the validateRequest to false in the page directive or in the web.config file?
Ahh, I didn't noticed that . I don't think there is other way to do this. BTW, what is the problem for turning it off in page level or web.config ?
|
|
|
|
|
because the basic requirement is that I provide a online html editor (implemented by using textbox) which allows user types in html markup , and submit to database.
and also I have other textboxes on the same page which do need the asp.net pagevalidate feature,
is any solution? any suggestion would be appricated!
Cheers,
Ming
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["mysession"].ToString() != null)
{
Label1.Text = "Welcome " ;
}
else
{
Response.Redirect("Login.aspx");
}
}
}
I have the above code in one aspx page. Before logging in if someone opens this page, it should open Login page. But instead of showing theLogin page, it shows Server Error. Any one have an idea.
|
|
|
|
|
What error are you getting in the page ?
Could you clarify that
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Soumini Ramakrishnan wrote: if (Session["mysession"].ToString() != null)
This is wrong. It should be
if (Session["mysession"] != null)
{
Label1.Text = "Welcome " ;
}
else
{
Response.Redirect("Login.aspx");
} When session is null , you can't invoke it's ToString() method.
|
|
|
|
|
Hi,
I had made some changes in yr code, just see below.
Try this code, i hope u can not get an error...
if (!IsPostBack)
{
if (Session["mysession"] != null)
{
Label1.Text = "Welcome ";
}
else
{
Label1.Text = "test";
}
}
i hope it will help u..
Rana Krishnraj
modified on Wednesday, April 2, 2008 9:30 AM
|
|
|
|
|
Thank you all. The given hints helped me and I rectified my problem.
|
|
|
|
|
hai to all,
My requirement is ,i want to insert multiple no of rows on a single save command with differnt values in a data table.
I want to do this using stored procedure with transaction.i dont have any idea of using procedure for multiple columns.
how to do this??
i have 6 fields which i have to insert differnt values in each row.No of rows also varied.can anybody give me simple example so that i can implement in my application.
i want to commit the data iff no of rows i want to insert equal to count(*) from that perticular table.
How to do this??please give me idea.
thanks in advance
kissy
|
|
|
|
|
How are you inserting records right now? We can't help unless we know what database you're using and how you're connecting to it. The commands are different depending on your answer. Most languages (both client side and SQL implementations) have a BEGIN TRANSACTION, COMMIT TRANSACTION and ROLLBACK TRANSACTION statement of some kind. I suggest you look up those commands for the platform you're using.
|
|
|
|
|
Hai All,
My requirement is to show the contents of a word file as it is in a dynamic web page without loosing it's formats?
Note that there will be images and text in my word file?
WHAT I DID
i tries to convert the .doc file into an html file and stores the multilingual code in the database, from there iam showing the contents into a dynamic page.
My problem is that the alignment is been breaking as some images are in the .doc file.
help me pls because it seems to be a complex task ?
|
|
|
|
|
|
Hi All,
I'm developing one application in asp.net 2.0
In that application logged in user can view the pages. If the user close the page with out signing out means how can I maintain their login status?
If I use the javascript in body unload means, I have to implement this script in many of the pages.
Give some better idea to solve this prob.
Thanks in Advance
A.Muthunagai
|
|
|
|
|
Muthunagai.A wrote: If the user close the page with out signing out means how can I maintain their login status?
Are you maintaining any DB flags for user status ? Usually you need to check the session existence in each page_load. If session is not exist, redirect user to the login page.
|
|
|
|