Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Wednesday, March 28, 2012

Set default page or Login page

Hi,

I want to change default setting for example i want to set signin.aspx as my login page or home.aspx as my default page. I saw somewhere that I could do this in web.config I can't remember where I saw!

Thanks, Amir Reza NL

You can change the loginUrl in the web.config by adding the <forms> element to the <authentication>:

<

authenticationmode="Forms">

<

formsloginUrl="">

</

authentication>

Hi

u can do this simply by right clicking on ur singin.aspx page and set it as ur start page.


The default sign-in page is done in the config file authentication/authorisation sections.

To redirect to a specifc home page can be done in a variety of ways... my preferred method is simply to add an application settings such as "HomePage" and then doing a quick test on incoming requests (server varible HTTP_REFERER) if the request originates outside the scope of you website do a redirect to the page defined as the "HomePage".

Hope this helps


I want to explain my problem further.

Suppose, u have tree sub folder (fd1,fd2,fd3) u have a page under fd1 (test.aspx) now when a user go to ~/fd1 I want test.aspx is shown to the user. One possible solution is to create default.aspx and redirect it to test.aspx but I don't like this approach.

Thanks,Amir Reza Nl


well, following is my advise:

there is a virtual directory corresponding to every folder/subfolder of your web application in IIS Manager.Find the right virtual directory( in your example, it's fd1) and perform a right click,choose thePeroperties and thenDocuments, in theEnable default content page section, you canchoose the page which you want to serve as the default page (in your example ,it's test.aspx).

there maybe some other alternative ways available, while i think what i have suggested is a good choice. think aobut it. :)

thanks.

Monday, March 26, 2012

set default login name

i want to set the default login name for user, i.e. each time the user use
the application, the login name would be displayed in advance and user only
need to input the password. how to do that'
million thanks..That depends, is this user creating an account.
Does the username exists already.
Is the username the same for all users or different for each user.
I'm assuming that the user has already got an account, and returning to the
site.
The way you can make the site remember a user is with cookies.
You set the cookie when the user logs in. Then whenever the page loads, it
looks of that cookie exists and if so, sets the users username in the
username textbox
"Grey" <erickwyum@.i-cable.com> wrote in message
news:%234sQC77nEHA.2808@.TK2MSFTNGP10.phx.gbl...
>i want to set the default login name for user, i.e. each time the user use
> the application, the login name would be displayed in advance and user
> only
> need to input the password. how to do that'
> million thanks..
>

Saturday, March 24, 2012

Set focus on null fields!

Hi,
I have a login form and I have two text boxes in it and the user is required to enter data in the textboxes.If they fail to enter data in any one of the text box and hit the submit button I would like for the cursor to setfocus on the empty text box for the user to enter the data.How would I do this in asp.net.If not would I be able to write Javascript and call the function and where would I call the function.COuld someone expalin how to accomplish this.I do know how to set focus on the first textbox when the page loads up.But I am lost when I am required to setfocus the cursor at the empty text box for user entry?try this:


string strScript = null;
strScript = "<script language=javascript> document.all('TextBox1').focus() </script>";
RegisterStartupScript("focus",strScript);

HI Azam,
I am getting a synatax error. Do I have to declare strScript in my Dim?Also is this a subroutine all by itself or is it part of another subroutine(like page_load)?
Hi,

try to put this code on the Server Side Button Click event.
HI Azam,
I tried your way but I get the error message that says strString is not declared.Also in your code the "TextBox1" would be the ID for the text boxes I have in my project Right?
declare strString as a string variable.

like this:


string strString = "whatever"; // C# syntax

Yes "TextBox1" is the id for the textboxes you have in yr project.
HI Azam,
I am doing this in VB .would the codes be any different if it is VB.
Only syntax.

Here is aC# to VB.NET converter.
HI Azam,
If I did it by your codes would I be able to set focus on the null fields or just the first text box.I am so many error message and that's why I could not see the results.Could you please mail me regarding this?Thanks.
Hi Picky,
Thanks.That is a cool tool!