|
You can register a startup script which will use javascript to close the window.
If you are using .net 2.0 and C# this code would work:
Type cstype = this.GetType();
StringBuilder tmpSB = new StringBuilder();
tmpSB.Append("<script type=text/javascript>");
tmpSB.Append("window.close();");
tmpSB.Append("</script>");
ClientScript.RegisterClientScriptBlock(cstype, "close", tmpSB.ToString());
If you are using .net 1.1 the call is a little different.
Hope that helps.
Ben
|
|
|
|
|
Thanks Ben, I'll give it ago
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
You can't clode a browser window from server side code, so you have to return a page that contains a Javascript that does it.
You can get rid of the redirect by directly returning a page. Example:
Response.Write("<html><head></head><body><script type=\"text/javascript\">window.close();</script></body></html>");<br />
Response.End();
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
I want to create a popup menu dynamically. The items of the popup will be the folders which i have created in my application.
For e.g. if i have 4 folders namely Folder1, Folder2, Folder3, Folder4
then under the folder option i should have 4 menu items namely Folder1, Folder2, Folder3, Folder4.These should be the popup items.
i.e. I have to create a popup menu by quering the database. The name of the folders are stored in the database.
Does anyone have any idea of how to go about in doing this?
Waiting for ur reply
Thanks
Riz
|
|
|
|
|
Hello,
Am new to Ajax and I had a requirement to develop a progress bar control in asp.net with Ajax
which can use call back functionallity to get the status of loading of page and show it in the UI
any help in this context is welcomed
would be very much help ful a worked out sample is available
Thanks
Krishna
|
|
|
|
|
I have the following code:
IWshRuntimeLibrary.WshNetwork myWSHNet;<br />
myWSHNet=new IWshRuntimeLibrary.WshNetworkClass();<br />
myWSHNet.AddWindowsPrinterConnection(@"\\ZEUS\HEAD013", "", "");<br />
myWSHNet.SetDefaultPrinter(@"\\ZEUS\HEAD013");<br />
I get the WSH Network object fine, and the new printer is created without any problems. What doesn't work is setting it to be the default printer. Anyone any ideas why?
|
|
|
|
|
Hello,
Does anybody know of some good (and maybe quite simple ) tutorials or examples of using ASP.NET 2.0 to make features from social networking sites like MySpace or Facebook? Things like adding/approving friends, joining groups, etc.
If anyone does, I will be very grateful!
Jack.
|
|
|
|
|
Any body tell me how to connect to the Active directory of a domain and authenticate a user from the asp.net webapplication.pls let me know .its an urgent requirement for me.
with thanks®ards
Madhu
|
|
|
|
|
|
i want to add first column and second column values to third column as a result(100+100=200) using gridview (asp.net using vb.net)and it should be updated into datatable.
can any one help me how come is possible with code example.
tahanks
S.A.Rahman
|
|
|
|
|
Hi,
Add Three template fields(for example label) to the grid view.
Bound the first 2 template fields to your table fields.
Then add "RowDataBound" Event handler to the grid view.
Add following code snippet into your RowDataBound event handler
Dim gr As GridViewRow = e.Row
If (gr.DataItemIndex <> -1) Then 'Not a header cell
Dim cell1 As Label = gr.FindControl("Label1") 'First cell's label ID
Dim cell2 As Label = gr.FindControl("Label2") 'Second cell's label ID
Dim cell3 As Label = gr.FindControl("Label3") 'third cell's label ID, here store result
'You want to convert the "cell1.Text, cell2.Text" to integer for addition
cell3.Text = cell1.Text + cell2.Text 'change this to your expression
End If
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
Hi
I am getting the system time.I check for a particular condition and depending upon that condition i should display time in either 12 hour format or 24 hour format along with PM or AM.
Can anybody tell me how to get time in 12 hour format and 24 hour format?
It's very urgent.
Thanks,
Riz
|
|
|
|
|
Are you looking for something like this:
dateTime.ToString("yyyy/MM/dd HH:mm:ss")
Ben
|
|
|
|
|
Do u know any code which can give me the time in either 12 hour format or 24 hour format?
It's really urgent.
|
|
|
|
|
Here is a link:
<a href="http://msdn2.microsoft.com/en-us/library/k494fzbf.aspx">http://msdn2.microsoft.com/en-us/library/k494fzbf.aspx</a>[<a href="http://msdn2.microsoft.com/en-us/library/k494fzbf.aspx" target="_blank" title="New Window">^</a>]
Formats:
' d :08/17/2000
' D :Thursday, August 17, 2000
' f :Thursday, August 17, 2000 16:32
' F :Thursday, August 17, 2000 16:32:32
' g :08/17/2000 16:32
' G :08/17/2000 16:32:32
' m :August 17
' r :Thu, 17 Aug 2000 23:32:32 GMT
' s :2000-08-17T16:32:32
' t :16:32
' T :16:32:32
' u :2000-08-17 23:32:32Z
' U :Thursday, August 17, 2000 23:32:32
' y :August, 2000
' dddd, MMMM dd yyyy :Thursday, August 17 2000
' ddd, MMM d "'"yy :Thu, Aug 17 '00
' dddd, MMMM dd :Thursday, August 17
' M/yy :8/00
' dd-MM-yy :17-08-00
so if you do dateTime.ToString(g) you would get 08/17/2000 16:32
Does that answer your question?
Ben
|
|
|
|
|
Look at the help for the format command.
Basically
TestStr = Format(TestDateTime, "hh:mm tt")
would return 3:55 pm
TestStr = Format(TestDateTime, "HH:mm")
would return 15:55
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
12 hour format :"h:mm:ss tt"
24 hour format "HH:mm:ss"
Hey Riz...me Dee
|
|
|
|
|
Hi,
In my application, there a label on left side and textbox on right side. Now if the culture is 'ar-SA' then textbox should shift to left side and label to right side. U can align the Text of the label and textbox by setting the 'dir' attribute as 'rtl' but u cannoth shift the control...How can this be done?
Kindly help me out here...
Thanks
|
|
|
|
|
Hi
give dir=rtl in html tag
<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl">
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
Hi,
You can done this at code behind
Provide id=htmlid runat="server" to head tag
<br />
<html xmlns="http://www.w3.org/1999/xhtml" id="htmlid" runat=server><br />
From code behind use
<br />
htmlid.Attributes.Add("dir", "rtl")<br />
to set attribute.
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
Hi, I did as you said..but that did not shift the 'position' of the controls...the label should be on right side and textbox should shift to left side...like the arabic way of entering data...
Kindly help me out,...
Thanks
|
|
|
|
|
Hi,
At First the page contains
Label: Textbox:
And when i give dir=rtl to html tag it is repositioned as
Textbox: Label:
is this you are expecting..
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
yes right...how can this be done?
|
|
|
|
|
Hi!
As everybody know IE7 supports XMLHttpRequest as Native Script Object .
for this i have an ajax application in which onclicking button, a select element is filled.the folowing code is working on Mozila,Netscape & Firefox but not on IE7.
if(window.XMLHttpRequest)
{
oXmlHttp=new XMLHttpRequest();
oXmlHttp.onload=Handler;
oXmlHttp.onerror=Handler;
return oXmlHttp;
}
in IE7 XMLHttpRequest() object is created but select element doesnot filled while in case of Mozilla it is working corrctly. what is problem?
Thanks & Regards,
SAMir Nigam,
Software Engineer,
STPL, Lucknow, India.
|
|
|
|
|
Hi all,
i developed one web application project , then i want to host it in to the website. how can i do this.
Pls help me.
|
|
|
|