|
This bit of code (visual studio 2005) will retrieve the logged in user name:
My.User.Name
I'm sure VS2003 and VB6 can accomplish this too, but you'll have to search for the actual syntax.
You could also store the user name in a cookie that gets saved on the computer. This would remember the last person who logged into the asp.net page on that computer, instead of whom ever is currently logged in... Code would look something like this:
'To Set the Cookie:
Response.Cookies("UniqueCookieName").Value = txtUserName.Text
Response.Cookies("UniqueCookieName").Expires = Now.AddYears(50)
'To Retrieve the cookie:
If Not Request.Cookies("UniqueCookieName") Is Nothing Then
txtUserName.Text = Request.Cookies("UniqueCookieName").Value
End If
Hope this helps.
|
|
|
|
|
hi,
i have developed an application using Asp.net and C#. But the when i try to login for the first time it redirect the page to login page instead of going to the second page. but it allow to move for the second time
|
|
|
|
|
You'll get better response to your queries if you
1) Don't ask the same thing twice within minutes
2) Don't mark it URGENT
only two letters away from being an asset
|
|
|
|
|
Hi,
Don't Repost the Same Question.
With Regards
Satips
|
|
|
|
|
If you are asking how to setup which page starts first, right click on the page in the Solution Explorer and select "Set as Start Page"
If that is not your question, could you please explain your problem with a little more detail?
|
|
|
|
|
another Solution
Onto web.config
<br />
<forms loginUrl="validate_user.aspx" protection="All"><br />
Onto validate User
<br />
if(user and password are valid)<br />
{<br />
Response.Redirect("index.aspx");<br />
}<br />
keep Learning and you never will be out of date...
|
|
|
|
|
hi,
i have developed an application using Asp.net and C#. But the when i try to login for the first time it redirect the page to login page instead of going to the second page. but it allow to move for the second time. Plz help me its urgent
|
|
|
|
|
Is there any way of getting around using the special characters inside the password field?
|
|
|
|
|
You might want to look at the CreateUserWizard.PasswordRegularExpression property.
|
|
|
|
|
My datagrid is bind with a datasource.
Now I need to add a number of rows dynamically to the datagrid, where rows contains controls. How to do this?
Help kindly appreciated.
Thanks.
The Phantom.
|
|
|
|
|
|
Hi everybody
I have datalist who have it inside ImagineButton.
protected void list_SelectedIndexChanged(object sender, EventArgs e)
{
int name=list.SelectedItemStyle.te
}
<asp:datalist id="list" runat="server" onselectedindexchanged="list_SelectedIndexChanged">
<itemtemplate>
<asp:imagebutton id="ImgBtnBanner"
="" tooltip="<%#Eval("Title") %>" imageurl="<%#Eval("ImageUrl") %>" postbackurl="<%#@"http://"+Eval("LinkUrl") %>" runat="server" cssclass="ImgBanner" alternatetext="<%#Eval("Id_banner") %>">
How can catch the clicked button.Please help me.
Good bye and hava a nice day.
when i want to read something good just seat and type it
|
|
|
|
|
I am looking for a code in javascript which does not allow decimal values in the Telephone No. field(i.e textbox)
Thanks & regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
function KeyCheck(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (((keycode>47) && (keycode<58) ) || (keycode==8)) { return true; }
else return false;
}
You can use this function for keypress so that it will not allow u to put any characters but only numeric.
If you have a HTML control then call this function by onkeypress="return KeyCheck(this,event);"
Else on server side code write TxtPhone.Attributes.Add("onkeypress","return KeyCheck(this,event)");
Vicky
"Walking on water and developing Software on a specification is easy, if
both are frozen..."
|
|
|
|
|
Thanks for your help....
Thanks & regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
how can i create a session in asp.net2005 using c#
dcjoshi2
|
|
|
|
|
Every time an user open your site on a browser window, it create a session automatically
Create a session variable with the user Id
string userId = (to consult the database)....
Session["userId"] = userId;
Check the session State
string stateSession = Session.Mode.ToString();
write these lines on all onload process pages in order to check if the session dont time out
<br />
try<br />
{<br />
string isAlive = Session["userId"].ToString();<br />
}<br />
catch(Exception)
{<br />
Response.Redirect("error.aspx");
}<br />
Ojala sea lo que buscas
i hope it was what you looking for
keep Learning and you never will be out of date...
|
|
|
|
|
hi
can any one give me the code for deletecommand event of the asp.net datagrid. iam displaying data from sqlserver.when i clicked the delete link of a particular row.that record should be deleted.
thanks
vijay
|
|
|
|
|
you know, Its a basic cuestion, everyone who developed a website has working that
but dont worry let me help you
delete Command using Sql query
<br />
private void DataGrid_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)<br />
{<br />
string userId = DataGrid.DataKeys[e.Item.ItemIndex].ToString();<br />
string query = "DELETE FROM users WHERE Id = '" + userId + "'";<br />
SqlCommand commandSql = new SqlCommand(query, conection);<br />
vG.conexion.Open();<br />
comandoSql.ExecuteNonQuery();<br />
vG.conexion.Close();<br />
}<br />
using dataSet synchronization
<br />
<br />
private void DataGrid_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)<br />
{<br />
DataSet dS = new DataSet();<br />
SqlDataAdapter dA = new SqlDataAdapter();<br />
string query = "SELECT * FROM users";<br />
SqlCommand commandSql = new SqlCommand(query, conection);<br />
dA.SelectCommand = comandSql;<br />
dA.Fill(dS);<br />
SqlCommandBuilder sCB = new SqlCommandBuilder(dA);<br />
dS.Tables[0].Rows[e.Item.ItemIndex].Delete();<br />
dA.Update(dS);<br />
Response.Redirect("Usuario_delete_ok.aspx");<br />
}<br />
keep Learning and you never will be out of date...
|
|
|
|
|
Is this for an exam that you should have studied for?
---
b { font-weight: normal; }
|
|
|
|
|
|
No more silly than your subject line and 1 line question (which can be answered using some simple searching)
|
|
|
|
|
r u an student or an developer.
With Regards
Satips
|
|
|
|
|
hai,
i am having a serious problem of session expiry in the remote server.
i am using asp.net +vb.net
i hav set the session expiry as 75min in the web.config but is getting only
15min.
How could i increase the session timeout at the remote server
plz reply ASAP
Nithin
|
|
|
|
|
have you tried timeOut in Web.config
|
|
|
|