|
CS1012: Too many characters in character literal
OnClick="javascript:window.open('catagory1.aspx')"
while i use onClintClick its work properly.
i want to open a new window and close previous window and onclint problem is that firstly open a page when i click next time on page than its show last time record beacause session value is comes from server onclick.
how can i solve this problem
please help
thanks
I will do my best?
|
|
|
|
|
One way people can tell a job was outsourced to india is the spelling errors. Like catagory.
OnClientClick is obviously what you want here, OnClick means you want to call a server side method. So, why are you trying to use it ? Why are you using a server control at all, if it just calls some javascript ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: One way people can tell a job was outsourced to india is the spelling errors. Like catagory
This comment is totally unnecessary.
|
|
|
|
|
Christian Graus wrote: One way people can tell a job was outsourced to india is the spelling errors
Christian,
I am an Indian and I was told in my primary school that the first letter of a proper noun should be capitalised. For your information, India is a proper noun.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
modified on Wednesday, August 13, 2008 6:01 PM
|
|
|
|
|
tell me a good javascript ebook on net
saurabh bhardwaj
|
|
|
|
|
I am not sure if they do have PDF version too, but this is one of the best organized JavaScript tutorial.
|
|
|
|
|
What book did you recommend?
|
|
|
|
|
I want to display on my intranet web page the username of the person that is logged onto the computer. I tried System.Environment.userName but it sometimes gives me "ASPNET”. Can someone please help me?
|
|
|
|
|
What kind of Authentication are you using?
|
|
|
|
|
|
try this:
string LstrUserName = HttpContext.Current.User.Identity.Name.ToString();
|
|
|
|
|
It says HttpContext is not declared
|
|
|
|
|
Hi , i m working in asp.net2.0 . In menu item click i want to open a popup window . can any one help me out , m new in asp.net
saurabh bhardwaj
|
|
|
|
|
Which part are you stuck on ? Do you know any html ? Do you know any javascript ? What menu are you using ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
hi , thanx 4 reply , in asp.net i m using menu . but there is no onclick evevt so that i run a javascript fuction on that . . i dnt how to open a popup window when i click on menuitem .
saurabh bhardwaj
|
|
|
|
|
window.open is how you open a window in javascript.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi , i m using this code but nothing happend .
script language=javascript>
function openPopup("Forms/frmAssignLeave.aspx?name=" + name)
{
window.open("Forms/frmAssignLeave.aspx?name=" + name,"title", "Height=300px, Width=300px");
}
/script>
asp:MenuItem Text="Assign Leave" Value="Assign Leave" NavigateUrl='javascript:openPopup("Forms/frmAssignLeave.aspx");' ></asp:MenuItem>
saurabh bhardwaj
|
|
|
|
|
I am Using Frameset on my page
in one frame displaying treeview
which get populated from database
and when user click i want to navigate 2 frame to some another aspx
how can i do that from code ,i want to write code in cs file
on selected index changed event of treeview
|
|
|
|
|
|
Response.Redirect("someotherpage.aspx");
|
|
|
|
|
Hello All,
How to avoid page being cached. Actually i'm creating an Admin Panel so as i click on Log Out button it brings me over the Default page for Log-in again. But the back button of the browser still working and i want to stop it. For it i'm using the following code. But page is still being cached.
Response.Buffer = true;
Response.ExpiresAbsolute=DateTime.Now.AddDays(-1d);
Response.Expires =-1500;
Response.CacheControl = "no-cache";
|
|
|
|
|
there are meta tags you could use, or since you're logged in i assume there is some sort of session varible involved, which could be checked for on page load, and removed on logout, so that if the var isnt present anymore(it expired, or the user logged out) it would redirect to the login screen.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Here i'm sending my all code for checking at page load still it's not working
if (!Page.IsPostBack)
{
Response.Buffer = true;
Response.ExpiresAbsolute=DateTime.Now.AddDays(-1d);
Response.Expires =-1500;
Response.CacheControl = "no-cache";
if (Session["UserName"] != null)
{
try
{
lblMsg.Text = Session["Type"].ToString()+" ("+ Session["UserName"].ToString()+")";
}
catch
{
Server.Transfer("../Admin/Default.aspx");
}
}
else
{
Server.Transfer("../Admin/Default.aspx");
}
}
|
|
|
|
|
I use Response.Redirect instead of Server.Transfer..which seems to be a general consensus but the reason why escapes me at the moment. You dont want to put your session checking code in a !postback block. you want to check every time so that when the session expires you dont get Null reference exceptions if its used outside of a try catch. what you have should work for the first time a page loads, but wont if the user does anything while they're on that page. what happens if you get rid of the !Page.IsPostBack if statement, and run the Response lines and the if(Session["UserName"] != null on every page load?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Sry sir i m not understanding plz explain a bit more............and i think i've already put my code here
|
|
|
|