|
Turn off anonymous access and then the page will auto re-direct to your login page if you are doing forms authentication.
A sample web.config is below.
The deny user="?" is what will deny anonymous access. The loginUrl is what will redirect to your login page.
<configuration>
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx" />
</authentication>
<authorization>
<deny user="?" />
</authorization>
</system.web>
</configuration>
Hope that helps.
Ben
|
|
|
|
|
Thanks Ben for your replied.
It works but I have some other issue though. On my Login.aspx page I have a Hyperlink for PasswordRecovery.aspx page. The Link stop working. Is there an alternate solution to make this Link working in case user forgotpassword.
Thanks,
eyungwah
|
|
|
|
|
Well, I guess what you would want to do is to create a new subfolder. In that subfolder you can have another web.config that has an allow statement so that "?" Anonymous users are allowed to access pages in that subdirectory. You can also put a location section with a path in it.
So it is like
<location path="yoursubdirectory">
Do the allow authorization stuff here
Hope that helps.
Ben
|
|
|
|
|
1) i have a template image column. i want to use different images, suppose if database row contains a doctype as pdf then show a small pdf image in the template column image, if its doc then show a small doc image in the template column image.
2) I also have a template button column on click of which i want to open the location of file associated with that particular row which is also stored in the database.
Please help me in this regard.
Thankyou
Bye
|
|
|
|
|
(1)
In item create event fire (for 2.0 Row data bound) of data grid while loading the row from the database
in this event you can check and set the image url.
(2) When you click on the button the item comman (for 2.0 Row command) event fire. you can as per your requirement.
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
Can you plz specify the code for it
Bye
|
|
|
|
|
In ItemDataBound event:
Dim img As System.Web.UI.WebControls.Image
img = CType(e.Item.FindControl("ImageName"), System.Web.UI.WebControls.Image)
img.ImageUrl = "Image/Check1.ico"
http://www.programmingknowledge.com/[^]
|
|
|
|
|
Hi everyone,
I'm having trouble with a datagrid that is supposed to insert data. But one row has to insert data in the data base using Radio button. So I created two buttons one of Bad Mood then the other one is Good mood. when one is selected, the data is to be inserted into the database. this is working well. But the problem comes when it comes to images, thes images are smilies. When good mood is selected I want a smiley to be inserted into the database too. So I created the smilies but when and made them invisible so I wrote this code to be able save them in the database but I'm getting two errors. Where could I be wrong?
document.getElementById("imggm").style.visibility = "hidden";
function ChangeSmile()
{
if (document.getElementById("rblmood_0"))
{
document.getElementById("imggm").style.visibility = "none";
document.getElementById("imggm").src = "laughing.gif";
}
else
{
document.getElementById("imgbm").style.visibility = "visible";
document.getElementById("imgbm").src = "sad.gif";
}
}
The errors are:
Invalid token '(' in class, struct, or interface member declaration
Invalid token '=' in class, struct, or interface member declaration
(This error appears on the line: document.getElementById("imggm").style.visibility = "hidden";)
Thanks.
|
|
|
|
|
Quit cross posting, dont you do this everytime you post?
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
By the looks of those errors your trying to compile and run this client-side Javascript server-side.....
|
|
|
|
|
Hi,
I want to know how do we use Digital signature to login into a website. I want something simliar to what is provided in the website www.irctc.co.in
Kindly open this site in IE and click on Agent Login. Here a pop asks for a certificate. This certificate is usually provided by a security device like a USB.
How do we create such an application.
Rohan
|
|
|
|
|
|
Hi All,
I am working with the tree view control for a secure site , which has numerous nodes.
But i get an error when i click on a node to expand it.I can see this only attimes(I guess it happens only when i don't give time for a node to expand and click on some other node to expand).
The error is like:-
Invalid postback or callback argument. Event validation is enabled using <pages enableeventvalidation="true"> in configuration or <%@ Page EnableEventValidation="true" %> in a page
Can anyone tell me how to prevent it from happening
Thanks & regards,
Jeeva
|
|
|
|
|
For whatever reason, when EnableEventValidation="true" you have to wait for the page to finish loading before you click on a control in the page. Otherwise you get an errror. In your page directive you could set EnableEventValidation="false".
|
|
|
|
|
Hi Friends,
After inserting the datas into the database the string should be cleared. but in my application for every refreshing it gets inputted again the previous value. pls how to clear those variables once the data has been inputted... pls help me
|
|
|
|
|
<br />
if (!ispostback)<br />
{<br />
}<br />
|
|
|
|
|
You will need to redirect the user to a page after submitting even if it is the same page. Also you will need to have some type of key that you can verify against to prevent this. If a user is on Page A and submits it goes to the DB, if they are returned to Page A or hit the button more than once it is going to be inserted over and over unless the Primary Key or Composite Key prevents this.
Also if you redirect them to Page B and they hit back in their browser and submit again, well there is another potential insert.
Google Search[^]
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I'm using a ValidationSummary with ShowMessageBox set to "True". It's
working fine with internet explorer but when it comes to Mozilla
Firefox it's not the same. No window is opened.
What can I do to make it work properly?Is there a way to do it?
Regards.
Tasleem Arif
|
|
|
|
|
I wasted hours trying to use the .net valdiator controls but they always gave me more trouble then they were worth. I suggest taking the time do write your own validation. Validating data with server side code is so much easier to write then client scripting. It also gives you so many more options to display information about the data to the user.
|
|
|
|
|
thanks for suggestion,but this site part of large site and that site uses that method i mean display message in Message Box using asp:summaryvalidator control, it works fine for IE but problem is with FireFox.
Regards.
Tasleem Arif
|
|
|
|
|
There are some options out there to edit the JavaScript that Microsoft uses for it's validations. You will probably need to look into that and edit it to use different options when it detects non IE browsers.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Hi there
I want to move between two pages without using the response redirect option pared with the eg. ?variable=0 . I dont want the variable to be displayed in the ULR menu. What would be the best way of doing this?
Thanks.
|
|
|
|
|
Use the Session object. On page 1:
Session["variable"] = 0;
Response.Redirect("~/Page2.aspx");
Then on page 2:
int variable = (int)Session["variable"];
|
|
|
|
|
Is there another way of doing it without using Session variables?
|
|
|
|
|
http://www.developer.com/net/asp/article.php/3299641[^]
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|