|
Follow Dhanasekarans Reply ..!It may Help..! Once I Got Resolved tht way..!
If It Helps Click It as Answer
|
|
|
|
|
I have a popup window js code where I am trying to put a name to that window. Even though I put the name, it is just not displaying. Following is my code. May i know please where I am doing wrong?
StringBuilder javascriptFunctionSB=new StringBuilder();
javascriptFunctionSB.Append("function DisplaySecurityGroupSummary() ");
javascriptFunctionSB.Append("{");
javascriptFunctionSB.Append("var title=\'" + GetLocalResourceObject("SecurityGroups").ToString() + "\';");
javascriptFunctionSB.Append("var summaryPopup = window.open(\"\",\"mywindow\" , \"menubar=0, resizable=0, width=350, height=350,scrollbars=1,toolbar =1\");");
javascriptFunctionSB.Append("summaryPopup.document.getElementsByTagName(\"body\")[0].innerHTML = \"\";");
javascriptFunctionSB.Append("summaryPopup.document.getElementsByTagName(\"body\")[0].innerHTML = \"" + summarySB.ToString() + "\";");
javascriptFunctionSB.Append("summaryPopup.moveTo(300, 300);");
javascriptFunctionSB.Append("summaryPopup.focus(); return false;");
javascriptFunctionSB.Append("}");
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"DisplaySecurityGroupSummary",javascriptFunctionSB.ToString(),true);
Please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
you can set it like
javascriptFunctionSB.Append("summaryPopup.document.Title='Title to be displayed'");
|
|
|
|
|
Sorry for late reply. Thanks for the same.
I tried to put the code and run the appln, but I am getting the error "object Expected" yellowish line highlighted at the code ,
onclick="return (DisplaySecurityGroupSummary());"
I am not getting any clue why the error is happening. Below is my code:
StringBuilder javascriptFunctionSB=new StringBuilder();
javascriptFunctionSB.Append("function DisplaySecurityGroupSummary() ");
javascriptFunctionSB.Append("{");
javascriptFunctionSB.Append("var title=\'" + GetLocalResourceObject("SecurityGroups").ToString() + "\';");
javascriptFunctionSB.Append("var summaryPopup = window.open(\"\",\"\" , \"menubar=0, resizable=0, width=350, height=350,scrollbars=1,toolbar =1\");");
javascriptFunctionSB.Append("summaryPopup.document.Title = 'mywindow')");
javascriptFunctionSB.Append("summaryPopup.document.getElementsByTagName(\"body\")[0].innerHTML = \"\";");
javascriptFunctionSB.Append("summaryPopup.document.getElementsByTagName(\"body\")[0].innerHTML = \"" + summarySB.ToString() + "\";");
javascriptFunctionSB.Append("summaryPopup.moveTo(300, 300);");
javascriptFunctionSB.Append("summaryPopup.focus(); return false;");
javascriptFunctionSB.Append("}");
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
First of all, there was mistake in the code that i have provided to you. It should be
javascriptFunctionSB.Append("summaryPopup.document.title = 'mywindow')");
instead of
javascriptFunctionSB.Append("summaryPopup.document.Title = 'mywindow')");
Now the problem of object expected may be in this line
javascriptFunctionSB.Append("summaryPopup.document.getElementsByTagName(\"body\")[0].innerHTML = \"" + summarySB.ToString() + "\";");
As it would render the string provided by you in the body of the pop up window. so just make sure that the summarySB.ToString() results in a valid html. you can view it in debug mode.
|
|
|
|
|
Message Posted Under Web- Development
modified on Thursday, September 24, 2009 4:29 AM
|
|
|
|
|
VikashGohil wrote: Can somebody tell me why it is not working.
Can you tell me how is this related to ASP.Net?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hello friend ,I am dispying a databse data in to grideview control.But porblem is ,i want to give the funcationality to change the order of column at runtime.Means i can change the order of column by just pick the column and put it where i want .Hoe to do this .Guide me
|
|
|
|
|
|
What is scope of Viewstate Variable?
|
|
|
|
|
prasadnjoshi wrote: What is scope of Viewstate Variable?
Please read this article,
Beginner's Guide To View State [^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Before flooding this forum with inane questions ( that all have the same title ), why not read a book or two ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
What is difference between Viewstate and Querystring?
|
|
|
|
|
Querystring is derved from the URL
Example: http://test.com/User.aspx?useid=123
And you need to retreive it on User.aspx as,
string UserID=Request.QueryString["userid"].ToString();
View State is one of the most important and useful client side state management mechanism. It can store the page value at the time of post back (Sending and Receiving information from Server) of your page. ASP.NET pages provide the ViewState property as a built-in structure for automatically storing values between multiple requests for the same page.
Example:
If you want to add one variable in View State,
ViewState["Var"]=Count;
For Retrieving information from View State
string Test=ViewState["TestVal"];
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
how can find out the last value of table
|
|
|
|
|
People are not Going to be patient as am to you. When you post a Qustion you need to be specific
if its an Identity Field you can do it like this
SELECT MAX(ID) AS LastID FROM mytable
or read this
http://blog.sqlauthority.com/2007/03/25/sql-server-identity-vs-scope_identity-vs-ident_current-retrieve-last-inserted-identity-of-record/[^]
Dont Forget to Google Next Time
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
select Top 1 * from table order by id Desc
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
This has nothing to do with ASP.NET, and it shows you have no idea at all what you're doing. You should start with a basic book.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi All,
I would like to perform some validation on an entry into a text box in the TextChanged event without causing the entire page to refresh.
In a Email-ID TextBox m checking whether that mailid is duplicate or not.
I want to prevent user by entering duplicate mail-id.
I used Update Panel, still it get refresh.
any solution ??
|
|
|
|
|
why text change event ? Its means you are doing post back on every changed of textbox char. Do it on Submit button click. And Place the control inside upodate panel.
Priyagdpl wrote: I used Update Panel, still it get refresh.
Do you have multiple update panel in the page ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
You can use the Generic Handler for this purpose. Just put ur whole logic to identify the duplicate email then call this handler via xmlhttprequest.
var xmlhttp;
function InitXmlHttpRequest() {
xmlhttp = null;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
function CheckDuplicateEmail(url) {
InitXmlHttpRequest();
var handleStateChanged = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
try {
alert("message from server : " + xmlhttp.responseText);
}
catch (e) {
}
}
else {
}
}
};
if (xmlhttp != null) {
xmlhttp.onreadystatechange = handleStateChanged;
xmlhttp.open("GET", url, true);
xmlhttp.send(null);
}
else {
}
}
now you can call this js method (CheckDuplicateEmail) on any event like textchangesd, lostfocus or keyup. Here the url is the Url of the Generic Handler u have created in previous step. The ResponseText will give you the data that u have returned from Generic Handler.
I hope it gonna help u.
|
|
|
|
|
I am adding a handler to dragdropcontrol(ajax control) on mouseup so that i can get new position of control when mouse is up and fire button click event from javascript function. even handler is added on pageLoad (javascript function). event gets fired with IE but not with firefox and google chrome. please help. code is given below:
C# code:
//***dpe is dragdropextender control
string strScript = @"<script type='text/javascript' language='javascript'> function pageLoad(){Sys.UI.DomEvent.addHandler($find('" + dpe.BehaviorID + "').get_element(), 'dragend', onMouseUp);} </script>";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", strScript);
Javascript function is:
function onMouseUp()
{
document.getElementById('<% =btnResetPosition.ClientID %>').click();
}
|
|
|
|
|
Hi All,
Custom conetext menu(Custom controls) of extended gridview is working only in IE, and not working in firefox. Kindly please suggest me the ways to fix it.
modified on Thursday, September 24, 2009 2:29 AM
|
|
|
|
|
saritha_codeproject wrote: Custom conetext menu(Custom controls) of extended gridview
What Do U Mean By Tht Can You please Explain..! May Be I am New
Is It MenuCountrol?
If No Plz Ignore..
If It Helps Click It as Answer
|
|
|
|
|
r u using any third party control ? if yes then specify which control u r using at what place and how?
|
|
|
|