|
Hi,
I am using this code 'Response.Write("<script>window.close()</script>;");' to close current form in Asp.net . but if i want to close any specific form as "employee.aspx" then what is the code of it.
please help me
Thanks !
Pankaj Singh
|
|
|
|
|
if your page is not opened then what is the use of closing it. You are using any Popup window? or want to close the browser itself ?
|
|
|
|
|
if this is in a new window then use Window.close()
If you are navigating to a page, just navigate to your login page rather than closing the whole browser through your code.
Other than this, you can use
self.close();
to close itself. You must run this from within employee.aspx.
|
|
|
|
|
Hi,
Im creating some little export module of an html page to different file type (xml html pdf etc)
When im exporting the page to html the file download pop up appears.
so far so good , however,
When I choose to open it , it opens on the current window.
How do i open it in another window or tab
thanks in advance
here is my code
StringBuilder str = new StringBuilder();
str.Append("<HTML>");
str.Append("<HEAD>");
str.Append("<TITLE></TITLE>");
str.Append("</HEAD>");
str.Append("<BODY>");
str.Append("<CENTER>");
this.page.Response.Clear();
this.page.Response.AddHeader("content-disposition","attachment;filename=StationData.htm");
this.page.Response.Charset = "";
this.page.Response.ContentType = "application/vnd.html";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
this.page.Response.Write(str.ToString());
this.page.Response.End();
|
|
|
|
|
|
Can you be more spesific about the SetTarget = new
thanks
|
|
|
|
|
use Window.Open from javascript and then call the handler which give you the response you created.
|
|
|
|
|
Use Response.Write(str.ToString()) only
dont use
this.page.Response.Write(str.ToString());
this.page.Response.End();
or try something like this
a new window
|
|
|
|
|
Hi All,
I'll be happy to get your option on this, i have a webservice that uses Semaphore to access shared (VB) resources and i noticed that when there is an high volume of webservice calls the semaphore could no make locks using the WaitOne() method, when using it, it throws an exception "Thread was being aborted." after 2 minutes.
I believe its aprobably a timeout error, but not sure what is the cause..
Can someone please explain what effects the lock? why t could be completed? what effects the timeout and can i configure somthing on the code or IIS or machine level to prevent that?
Thanks
|
|
|
|
|
How to get count value of No of visitor visited to our webpage?
|
|
|
|
|
Create counter in your global.aspx
|
|
|
|
|
I have to get which Ip is opened? & its IP address? & how many pages they have visited? How long they have opened per page? what is the webpage opening time & what is closing time of web page?
|
|
|
|
|
why dont you use Google Analytics for this?
|
|
|
|
|
Hello everybody,
From last 3years i developed an Accounting Inventory Payroll Manangement system .
It is running very successfully in UAE.I used VB and SQL Server and some C++ utilities in my program.
Now i want to develop an Online Inventory System.
So i am seeking advices from every one related to web Development.
From ur point of View actually what will be the easies tool for web development ?
I want high speed data accessibility and report generation.More over the the storage capacity of
the backend must be high.
Expecting all suggestions and advices
|
|
|
|
|
i want to create an xml file in the asp.net during runtime. While i compiled the code then i want to create a new xml file and to store the data from sql database...
Regards,
Karthikeyan
|
|
|
|
|
karthikeyanruby wrote: While i compiled the code then i want to create a new xml file
I didn't get you, what do you mean by that ?
|
|
|
|
|
DataSet dsReport = //get data from DB
dsReport.WriteXml(Server.MapPath("Employees1.xml"));
|
|
|
|
|
i m a bit confused about encryption of connection string in a website......i hv gone through some sites...some tells via using aspnet_regiis and some specifies other functions.... i dont know which one to use and for that do i need to install additional tool........plz guide me
|
|
|
|
|
If you want to encrypt a connection string ( which is at least mildly retarded ) then just do it with the Cryptography stuff built in to .net
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.
|
|
|
|
|
agree
|
|
|
|
|
|
Hi,
Our production apps running on Windows 2003 Server and most of our
Applications are authenticated against Active Directory. For couple of
applications the "Digest authentication for Windows domain servers"
option is selected so when users try to access those web applications
the login window " ... at Digest requires a Username and Password"
pops up for credentials to get the access. But now we decided
to remove that log in and let the users directly access some of
the pages with out having to provide log in information (only they click on
Edit they need to provide the authentication information).
So to make this happen I just went a head and un checked the "Digest
authentication for Windows domain servers" option on IIS to disable the log in box. But it still
pops the log in window and expecting the authentication needs to be
provided. Is there a place I still need to be looking at under the
properties on IIS for that application?
Thanks,
-L
|
|
|
|
|
My task is to create a dynamic widget. A part of the widget is creating tabs. Once the widget is rendered on the client side it should display the layout. Part of the layout is creating a tab control that displays dynamic data. Please find a copy of the code pasted below.
The final step is to implement the inline Javascript so that it gives the behavior and format the tab control accurately. How do I do this?
----------------------------------------------------------------------------------------------------------------------------------------
Public Sub GenerateBullets(ByVal ID As Int64)
Try
Dim BulletList As List(Of FlexOffers.Entities.Content)
Dim LongReview As List(Of FlexOffers.Entities.Content)
LongReview = p.Content.GetContentByTransactionID(ID, ConfigurationManager.AppSettings("TrackURL"), 36)
BulletList = p.Content.GetContentByTransactionID(ID, ConfigurationManager.AppSettings("TrackURL"), 34)
LongReview = p.Content.GetContentByTransactionID(ID, ConfigurationManager.AppSettings("TrackURL"), 36)
JavaCode.Append("document.write('<div style=""width:100%"">');")
If BulletList.Count > 0 Then
With JavaCode
.Append("document.write('")
.Append("<table cellspacing=""0"" cellpadding=""0"" border=""0"" width=""100%"" style=""font-family:Arial, Helvetica, sans-serif;"">")
.Append("<tbody>")
.Append("<tr>")
.Append("<td width=""140"" style=""text-align:left; vertical-align:top; padding-right:10px;"">")
.Append("<a href=""" & strLink & """ target=""_blank"">")
If BulletList(0).Image.ID > 0 Then
.Append("<img alt=""Apply Now"" title=""Apply Now"" src=""http://content.linkoffers.net/SharedImages/Products/" & BulletList(0).ProductID & "/" & BulletList(0).Image.ID & "." & BulletList(0).Image.Extension & """ border=""0"" style=""border-color:#cccccc; border-style:solid; border-width:1px;"">")
Else
.Append("<img alt=""Apply Now"" title=""Apply Now"" src=""http://content.linkoffers.net/SharedImages/image_replace.gif"" border=""0"" style=""border-color:#cccccc; border-style:solid; border-width:1px;"" >")
End If
.Append("<\/a>")
.Append("<table border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">")
.Append("<tr>")
.Append("<td colspan=""2""> </td>")
.Append("<\/tr>")
.Append("<tr>")
.Append("<td style=""padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; width:60px; text-align:left; font-weight:bold; font-size:12px; background-color:#eeeeee; border-color:#cccccc; border-width:1px; border-style:solid;"">Intro Rate<\/td>")
.Append("<td style=""padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; width:80px; text-align:left; font-size:12px; background-color:#ffffff; border-top-color:#cccccc; border-top-width:1px; border-top-style:solid; border-bottom-color:#cccccc; border-bottom-width:1px; border-bottom-style:solid; border-right-color:#cccccc; border-right-width:1px; border-right-style:solid;"">No Introductory Rate Available <\/td>")
.Append("<\/tr>")
.Append("<tr>")
.Append("<td style=""padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; width:60px; text-align:left; font-weight:bold; font-size:12px; background-color:#eeeeee; border-bottom-color:#cccccc; border-bottom-width:1px; border-bottom-style:solid; border-left-color:#cccccc; border-left-width:1px; border-left-style:solid; border-right-color:#cccccc; border-right-width:1px; border-right-style:solid;"">APR<\/td>")
.Append("<td style=""padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; width:80px; text-align:left; font-size:12px; background-color:#ffffff; border-bottom-color:#cccccc; border-bottom-width:1px; border-bottom-style:solid; border-right-color:#cccccc; border-right-width:1px; border-right-style:solid;"">24.50%*<\/td>")
.Append("</tr>")
.Append("<tr>")
.Append("<td style=""padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; width:60px; text-align:left; font-weight:bold; font-size:12px; background-color:#eeeeee; border-bottom-color:#cccccc; border-bottom-width:1px; border-bottom-style:solid; border-left-color:#cccccc; border-left-width:1px; border-left-style:solid; border-right-color:#cccccc; border-right-width:1px; border-right-style:solid;"">Fee</td>")
.Append("<td style=""padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; width:80px; text-align:left; font-size:12px; background-color:#ffffff; border-bottom-color:#cccccc; border-bottom-width:1px; border-bottom-style:solid; border-right-color:#cccccc; border-right-width:1px; border-right-style:solid;"">$150**<\/td>")
.Append("</tr>")
.Append("</table>")
.Append("<\/td>")
.Append("');")
.Append("document.write('")
.Append("<td style=""vertical-align:top;"">")
.Append("<span style=""display:block; text-align:left; vertical-align:top; padding-bottom:10px;"">")
.Append("<a href=""" & strLink & """ style=""font-size:16px; font-weight:bold;"" target=""_blank"">")
.Append(Replace(BulletList(0).ProductName, "'", "\'"))
.Append("<\/a>")
'If BulletList(0).Product.Name <> BulletList(0).Program.Name Then
.Append("<span style=""font-size:11px; color:#999999;""> - ")
.Append("By " & Replace(BulletList(0).Program.Name, "'", "\'"))
.Append("<\/span>")
'End If
.Append("<\/span>")
.Append("<ul style=""margin ; padding-left:15px; font-size:12px; padding-bottom:10px;"">")
.Append("');")
For Each Bullet As FlexOffers.Entities.Content In BulletList
.AppendLine("document.write('<li style=""padding-bottom:5px;"">" & (Replace(Replace(Replace(Bullet.Content, vbCrLf, ""), "’", "'"), "'", "\'")) & "</li>');")
Next
.Append("document.write('")
.Append("</ul>")
.Append("<span style=""display:block; font-size:14px; font-weight:bold;"">")
'.Append("»")
Try
If BulletList(0).Product.LinkText.Length > 0 Then
.Append("<a href=""" & strLink & """ target=""_blank"">" & BulletList(0).Product.LinkText & "</a>")
Else
.Append("<a href=""" & strLink & """ target=""_blank"">Apply Now</a>")
End If
Catch ex As Exception
.Append("<a href=""" & strLink & """ target=""_blank"">Apply Now</a>")
End Try
.Append("<\/span>")
If Len(BulletList(0).Product.Terms) > 0 Then
.Append("<span style=""display:block; font-size:11px; padding-top:10px; width:150px;"">")
.Append("<a href=""#"" onClick=""window.open(\'")
.Append(BulletList(0).Product.Terms)
.Append("\',\'\',\'scrollbars=yes,width=600,height=400\');"" class=""off4"" >Terms and Conditions<\/a>")
.Append("<\/span>")
End If
.Append(" ")
'This is end of tab control
.Append("<\/td>")
.Append("<\/tr>")
.Append("<\/tbody>")
.Append("<\/table>")
'This is beginning of tab control
'This is the Javascript Code for Tab Control
.Append(" ")
.Append("<style type=""text/css"">html, body, h1, h2, p, ul, ol, li, pre {")
.Append("margin: 0;padding: 0;")
.Append("}")
.Append("ul")
.Append("{")
.Append("list-style-type: none;")
.Append("}")
.Append("code")
.Append("{")
.Append("font-size: 100%;color: #666;")
.Append("}")
.Append("body")
.Append("{")
.Append("background: url(bg.gif) 50% 0 repeat-y #F5F5F5;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: small;color: #333; ")
.Append("}")
.Append("#km-wrapper")
.Append("{")
.Append("width: 768px;margin: auto;background: #fff;")
.Append("}")
.Append("#km-wrapper-inner")
.Append("{")
.Append("padding: 40px 20px;")
.Append("}")
.Append("h1.km-def")
.Append("{")
.Append("margin: 0 0 20px 0;color: #000;")
.Append("}")
.Append("h2.km-def")
.Append("{")
.Append("font-size: 100%;margin: 30px 0 20px 0;color: #000;")
.Append("}")
.Append("p.km-def")
.Append("{")
.Append("margin: 0 0 20px 0;line-height: 140%;")
.Append("}")
.Append("ul.km-def, ol.km-def")
.Append("{")
.Append("margin: 0 0 20px 0;")
.Append("}")
.Append("ul.km-def, ol.km-def li")
.Append("{")
.Append("margin-left: 40px;line-height: 140%;")
.Append("}")
.Append("ul.km-def")
.Append("{")
.Append("list-style-type: square;")
.Append("}")
.Append("pre.km-def")
.Append("{")
.Append("font-size: 100%;color: #999;margin: 0 0 20px 0;border: 1px solid #ccc;padding: 5px 10px;")
.Append("}")
.Append("a.km-def")
.Append("{")
.Append("text-decoration: none;font-weight: bold;border-bottom: 1px solid #ccc;color: #666;")
.Append("}")
.Append("a.km-def:hover")
.Append("{")
.Append("background: #F3F3F3;color: #000;border-bottom: 1px solid #000;")
.Append("}")
.Append(".new")
.Append("{")
.Append("background: url(n_eng.gif) 100% 0 no-repeat;padding-right: 25px;")
.Append("}")
.Append("img.km-def")
.Append("{")
.Append("border: 2px solid #ccc;")
.Append("}")
.Append("h1")
.Append("{")
.Append(" position: relative;overflow: hidden;left: -15px;")
.Append("}")
.Append("h1 span")
.Append("{")
.Append("display: block; position: absolute; top: 0; left: 0; z-index: 1")
.Append("}")
.Append("h1, h1 span")
.Append("{")
.Append("width: 294px;height: 109px;background-image: url(logo.gif);")
.Append("}")
.Append("div.demolayout")
.Append("{")
.Append(" width: 100%;margin: 0 0 20px 0;")
.Append("}")
.Append("ul.demolayout")
.Append("{")
.Append("list-style-type: none; width: 100%;float: left;background: url(pixel.gif) bottom left repeat-x;")
.Append("}")
.Append("ul.demolayout li")
.Append("{")
.Append("margin: 0 2px 0 0;float: left;")
.Append("}")
.Append("ul.demolayout a")
.Append("{")
.Append("float: left;display: block;padding: 4px 8px; border: 1px solid #ccc;border-bottom: 0;color: #666;background: #eee;text-decoration: none;font-weight: bold;")
.Append("}")
.Append("ul.demolayout a:hover")
.Append("{")
.Append(" background: #fff;")
.Append("}")
.Append("ul.demolayout a.active")
.Append("{")
.Append(" background: #fff;padding-bottom: 5px;cursor: default;color: #00f;")
.Append("}")
.Append(".tabs-container")
.Append("{")
.Append("clear: left;border: 1px solid #ccc;border-top: 0;padding: 20px 8px 0 8px;")
.Append("}")
.Append("#demo h2")
.Append("{")
.Append("font-size: 100%;margin: 0 0 20px 0;")
.Append("}")
.Append("</style>")
.Append("<div id=""demo"" class=""demolayout"">")
.Append("<ul id=""demo-nav"" class=""demolayout"">")
.Append("<li class=""democlass""><a href=""#tab1"">Review</a></li>")
.Append("<li><a href=""#tab2"">Rates & Fees</a></li>")
.Append("<li><a href=""#tab3"">Rewards</a></li></ul>")
'This is the review tab
.Append("<div class=""tabs-container"">")
.Append("<div class=""tab"" id=""tab1"">")
.Append("<h2>Review</h2>")
.Append("<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nisl elit, facilisis nec vestibulum aliquam, adipiscing ac lectus. Praesent libero ipsum, volutpat eu porta vel, molestie ut purus. Donec et lorem a justo pellentesque feugiat eu eget diam. Aliquam non interdum leo. Sed auctor tortor ac mauris ullamcorper placerat. Praesent sit amet arcu ac nisiinterdum pellentesque et consequat metus. Ut eget mauris nisl. Aenean mattis sem eget dolor blandit vitae mollis elit faucibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p></div>")
'This is the Rates and Fees tab
.Append("<div class=""tab"" id=""tab2"">")
.Append("<h2>Review</h2>")
.Append("<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nisl elit, facilisis nec vestibulum aliquam, adipiscing ac lectus. Praesent libero ipsum, volutpat eu porta vel, molestie ut purus. Donec et lorem a justo pellentesque feugiat eu eget diam. Aliquam non interdum leo. Sed auctor tortor ac mauris ullamcorper placerat. Praesent sit amet arcu ac nisiinterdum pellentesque et consequat metus. Ut eget mauris nisl. Aenean mattis sem eget dolor blandit vitae mollis elit faucibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p></div>")
'This is the Rewards tab
.Append("<div class=""tab"" id=""tab3"">")
.Append("<h2>Rewards</h2>")
.Append("<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nisl elit, facilisis nec vestibulum aliquam, adipiscing ac lectus. Praesent libero ipsum, volutpat eu porta vel, molestie ut purus. Donec et lorem a justo pellentesque feugiat eu eget diam. Aliquam non interdum leo. Sed auctor tortor ac mauris ullamcorper placerat. Praesent sit amet arcu ac nisiinterdum pellentesque et consequat metus. Ut eget mauris nisl. Aenean mattis sem eget dolor blandit vitae mollis elit faucibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p></div>")
.Append("</div></div>")
.Append("');")
End With
Else
With JavaCode
.Append("document.write('")
.Append("<div class=""topbar"">")
'.Append(";")
'.Append("document.write('")
.Append("<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">")
.Append("<tr>")
.Append("<td>")
.Append("<font face=""Arial, Helvetica, sans-serif"" size=""3"">")
.Append("<b> <\/b>")
.Append("<\/font>")
.Append("<\/td>")
.Append("<\/tr>")
.Append("<\/table>")
.Append("');")
End With
End If
JavaCode.Append("document.write('</div>');")
If Request.QueryString("T") IsNot Nothing Then
If Request.QueryString("T") = "1" Then
JavaCode = JavaCode.Replace("http:", "https:")
End If
End If
Response.ContentType = "text/javascript"
Response.Write(JavaCode.ToString)
Catch ex As Exception
Response.End()
End Try
End Sub-------------------------------------------------------------------------------
|
|
|
|
|
You can't be serious with this.
You can remove half of this code by creating a CSS file and referencing it rather than try writing it out. You're also writing out inline styles rather than using a class reference from your CSS.
You don't even need to use the document.write method to create the content, use an AJAX call. You could also use a Repeater control and populate the relevant area using databinding
only two letters away from being an asset
|
|
|
|
|
Thanks for the Response!!!
I understand what your saying, however I am creating a widget. With that being said, do you know how i would implement the following Javascript in the widget.
<pre> .Append("<script type=""text/javascript>""")
.Append("function showHide(shID) {")
.Append("if (document.getElementById(shID)){")
.Append("document.getElementById(shID+""-show"").style.display != ""none"") {")
.Append("document.getElementById(shID+""-show"").style.display = ""none"";")
.Append("document.getElementById(shID).style.display = ""block"";")
.Append("}")
.Append("else {")
.Append("document.getElementById(shID+""-show"").style.display = ""inline"";")
.Append("document.getElementById(shID).style.display = ""none"";")
.Append("}")
.Append("}")
.Append("}")
.Append("</script>")
.Append("<div id=""demo"" class=""tablayout"">")
.Append("<ul id=""demo-nav"" class=""tablayout"">")
.Append("<li class=""tabclass""><a href=""#tab1"" onclick=""getElementById(""tab1"").showHide(""tab1"");return true;"">Review</a></li>")
.Append("<li><a href=""#tab2"" onclick=""getElementById(""tab2"").showHide(""tab2"");return true;"">Rates & Fees</a></li>")
.Append("<li><a href=""#tab3"" onclick=""getElementById(""tab3"").showHide(""tab3"");return true;"">Rewards</a></li></ul>")
'This is the review tab
.Append("<div class=""tabs-container"">")
.Append("<div class=""tab"" id=""tab1"">")
.Append("<h2>Review</h2>")
.Append("<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nisl elit, facilisis nec vestibulum aliquam, adipiscing ac lectus. Praesent libero ipsum, volutpat eu porta vel, molestie ut purus. Donec et lorem a justo pellentesque feugiat eu eget diam. Aliquam non interdum leo. Sed auctor tortor ac mauris ullamcorper placerat. Praesent sit amet arcu ac nisiinterdum pellentesque et consequat metus. Ut eget mauris nisl. Aenean mattis sem eget dolor blandit vitae mollis elit faucibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p></div>")
'This is the Rates and Fees tab
.Append("<div class=""tab"" id=""tab2"">")
.Append("<h2>Rates And Fees</h2>")
.Append("<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nisl elit, facilisis nec vestibulum aliquam, adipiscing ac lectus. Praesent libero ipsum, volutpat eu porta vel, molestie ut purus. Donec et lorem a justo pellentesque feugiat eu eget diam. Aliquam non interdum leo. Sed auctor tortor ac mauris ullamcorper placerat. Praesent sit amet arcu ac nisiinterdum pellentesque et consequat metus. Ut eget mauris nisl. Aenean mattis sem eget dolor blandit vitae mollis elit faucibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p></div>")
'This is the Rewards tab
.Append("<div class=""tab"" id=""tab3"">")
.Append("<h2>Rewards</h2>")
.Append("<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nisl elit, facilisis nec vestibulum aliquam, adipiscing ac lectus. Praesent libero ipsum, volutpat eu porta vel, molestie ut purus. Donec et lorem a justo pellentesque feugiat eu eget diam. Aliquam non interdum leo. Sed auctor tortor ac mauris ullamcorper placerat. Praesent sit amet arcu ac nisiinterdum pellentesque et consequat metus. Ut eget mauris nisl. Aenean mattis sem eget dolor blandit vitae mollis elit faucibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p></div>")
.Append("</div></div>")</pre>
|
|
|
|
|