|
I am developing an application using ASP.Net+C# with back-end SQL Server2000.
users data table is available in SQL Server2000. how to authenticate the users who are available in SQL Server using Login Authentication control. i want to write the code only in front-end in ASP.Net using C#.net application . Also if i copy the url and paste the url in another page the home page is being getting accessed. i want to prevent the accessibility if any body paste the url by copying the url and pasting it in another internet explorer
rajsekhar
|
|
|
|
|
Yo!
Use session variables to store the login details of the user.
And when your home page loads, check if these session variables have acceptable values, if not, redirect to login page...
M
|
|
|
|
|
What marky777 said is right.
You should use one Session variable in your basepage. You should check whether this is authenticated user or not. Since the code is written under basepage, it will automatically check the user in each and every pages' load.
Some people use Cookie to handle that thing instead of Session.
|
|
|
|
|
kindly send a dummy project...plz..using login authentication control
|
|
|
|
|
Here is the sample.
In MasterPage
protected override void OnLoad(EventArgs e)<br />
{<br />
base.OnLoad(e);<br />
if( Session["UserInfo"] == null && Request.Url.AbsolutePath != "webprj/login.aspx"){<br />
Response.Redirect("login.aspx");<br />
}<br />
}<br />
In LogIn.aspx
Session["UserInfo"] = "AuthenUsr";
act, this sol is .NET 1.1 fashion. i can't test 2.0 now.. for the time being, you may read this article
I will reply the sol with login control in next thread...
|
|
|
|
|
Thank u...for ur message...
ur program is most useful..
Also kindly suggest how to restrict the login attempts to 3 times after using the above code
|
|
|
|
|
Hi,friends....can you tell me how many web.config files can i have in a single web application?....
Hi,Im Razana
|
|
|
|
|
U can have many web confing file in single web application but not in same root
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Your hard disk space is the limit*
*Conditions Apply
Terms and Conditions:
1) At the application root level, you can use Session, Authentication etc keys (MachineToApplication )
2) Other web.config can have only lesser power keys.
|
|
|
|
|
how to stop time interval in java script forever
i want to stop this:-
setInterval('scroll()',1000);
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
9313077379
|
|
|
|
|
my asp.net application using crystal reports...the application execute fine and well on my local machine...
my problem was, when i deploy my asp.net application in the server it works fine
but there the exporting of report does not work it gives me a blank page....
my findings was, the why export does not function is because the server dont have
a crystal report application.. i just used my reference embeded in my asp.net application... is my finding correct? or really there is something i miss to code in my application...
pls i need your help very badly... can you give me a link or a sample code?... that will work to a server that does not have crystal software installed.
start a new beginning in every ending; thats what life for......
|
|
|
|
|
How can i caluclate infinite precision with out loosing any decimal
eg. 1.3 * .344536345234246356664745
I want the result with all decimal.
which datatype can use.
thks
|
|
|
|
|
From what I know there is no way to calculate infinite precision with out loosing any decimal
You may want to take a look at these data types
The nearest datatypes you can use are float, double and decimal.
Just call me Valy...
|
|
|
|
|
Use Double Datatype.
Double variables are stored as signed IEEE 64-bit (8-byte) double-precision floating-point numbers ranging in value from -1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values and from 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
You can not have infinite precision, as you don't have an infinite amount of memory availabe.
The Decimal data type is the built-in type that gives you the highest precision. If that is not enough, you need to create your own data type or find someone who has.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi, I'm trying to read a blob from my database table but ran into a little problem that I can't seem to solve. The following code is used in the page load and the button_click section of the code behind. I got the exception
"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" when I tried to view it in the browser.
<br />
Dim i As Integer<br />
For i = 0 To ListBox2.Items.Count - 1<br />
If ListBox2.Items(i).Selected Then<br />
Dim myCon As New OdbcConnection<br />
<br />
myCon = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=myDB;User=myUserassword=myPass;Option=3;")<br />
Dim cmd As New OdbcCommand("SELECT * FROM myTable where Professions = '"& ListBox2.Items(i).Text &"' ")<br />
<br />
myCon.Open()<br />
<br />
cmd.Connection = myCon<br />
<br />
Dim ds As New DataSet<br />
<br />
Dim ad As New OdbcDataAdapter(cmd)<br />
<br />
ad.Fill(ds)<br />
<br />
Me.ListBox2.DataSource = ds<br />
<br />
Me.ListBox2.DataTextField = "Professions"<br />
<br />
Me.ListBox2.DataBind()<br />
End If<br />
Next<br />
I searched online for possible causes of this error but, none of the causes that I found has anything to do with my situation. Please take a look to see what I might of missed, thank you in advance for your help.
-- modified at 3:46 Wednesday 11th July, 2007
|
|
|
|
|
Where are you making this call in code? Is this Single or Multi select?
Have a look at MSDN[^], and the ListBox class, specifically the OnSelectedIndexChanged event and the SelectedIndex, SelectedItem and SelectedValue properties, ListBox members[^].
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
|
That mistake was already spotted when I last post a message a day ago but I forgot to change it when I paste the code in the message box. Unfortunately thats not the problem but thanks for your help. This call is made in the page load and in the button1_click sections of the code behind. The listbox is in multi-select mode.
|
|
|
|
|
Hi
What u want to do here?
Your code is totally wrong.
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
I am trying to read blobs from a field in a database table. The blobs hold resumes and each resume can have one or many corresponding professions in the Professions field. I am trying to enable users to look up resumes forcertain professions by choosing one or many professions in the listbox. The Select statement selects my table where the text of the listitem chosen by the users match the profession in the Professions field.
|
|
|
|
|
on which event u call this code?
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Imran Khan Pathan is right... I didn't see it the first time but you are doing something like these
You have a "for" that walks through the listBox2 elements and sees which is selected...then you make a query in the database (inside that "for") and you bind the result of the query with the same listBox2...these alters the containt of the listBox2 and the for is not working anymore (ListBox2.Items.Count is not the same after you have done the binding in the "for" statement and also the ListBox2.Items are changed)
Just call me Valy...
|
|
|
|
|
You are changing the items of the list box while you are looping through the items.
---
single minded; short sighted; long gone;
|
|
|
|
|
I've used the for loop to determine the list item selected by the user. Then I used the select statement to select the profession that is equal to the text of the list item that was selected. If I change the contents of listbox2 during each iteration of the loop when I bind the data to listbox2, then does that mean I can't use the for loop like I did? Should I bind the data out side of the for loop? I'm going to try and change the sequence of my code, but please give me some suggestions on how to remedy this code.
|
|
|
|