|
Here is some vb.net code I wrote a while back. I had the user press a save button that did a post back and then called this method:
Private Sub closewindow(ByVal indate As Date)
Dim myScript As New StringBuilder
With myScript
.Append("<script>")
.Append(Environment.NewLine)
'This code sets the correct field on the opener form
Dim tmpstr As String = "self.opener.document.forms[0]." + CStr(Session("DatelookupField"))
.Append(tmpstr)
.Append(".value = """)
.Append(indate.ToShortDateString)
.Append("""")
.Append(Environment.NewLine)
'focus the opener form
.Append("self.opener.focus()")
.Append(Environment.NewLine)
'Close the calendar window
.Append("self.close()")
.Append(Environment.NewLine)
.Append("</script>")
Page.RegisterStartupScript("close window", .ToString())
End With
End Sub
All this code is .net 1.1 I set a session variable in the parent form so I knew what the control name was to pass the date back to the parent form.
Hope that helps.
Ben
|
|
|
|
|
want to create a report just like report builder as provided by .net framework in word .User can drag and drop the fields in Ms word file .I started approaching to VSTO 2005.
I want to create Office projects using VSTO under visual studio 2005.
Is VSTO Free? I assumed that it is and i've followed the instructions from MSDN.
I've:
- installed office 2003 with its sp1,
- installed office interop assemblies: O2003PIA package - 5MB which came out from oxppia - self extractor 1,69MB
- used vstor.exe - 1,27MB
- used OfficeVSTOWindowsInstaller 187KB
I still don't see in my project types Office projects under New->Project and I can't open any samples as it shouts that this type is not supported...
kindly help me how should I approach ....
PKSAHOO
|
|
|
|
|
Hello,
I want to send log-data to a client over TCP/IP and UDP. As data format I think the best way is to use XML. Now I search a possibilty to make a well formed Xml file from the data. I have found some solutions with External entities. But here I have the problem that I have an live stream and I don't want to make allways a new file of the stream.
What is the best solution to do this?
It would be great If in the future I have the possibilty to open the log-server also with an internet explorer...may be someone can give me some hints...
Best regards
Hansjörg
|
|
|
|
|
This will work. Put it as the only code in a page behind file.
protected void Page_Load(object sender, EventArgs e) {
Response.Clear();
Response.ContentType = "text/xml";
XmlSerializer xml = new XmlSerializer(typeof(SomeObject));
xml.Serialize(Response.Output, someObject));
Response.Flush();
Response.Close();
}
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I have to display videos in asp.net any one is there to help me
|
|
|
|
|
|
Hi Jon,
I don't have any idea about it so help in that
|
|
|
|
|
Hi,
U send the code but i am using only asp.net 2.0 in that there is no such facility what i have to do
|
|
|
|
|
|
I have two check Boxes,by clicking one checkbox,i should get one window like lyaer not exactly window,in which i should enter some data like,empNo----
Empname----i hv to save that data.
and again by clicking another checkbox,i should get those details by text.
Plz help me on this,
Thx in advance
|
|
|
|
|
Hi,
By using javascript you can do that.
Regards,
Sandeep Kumar.V
|
|
|
|
|
Hi all,
How to disable the close button using javascript using window.open()
-- modified at 7:57 Tuesday 16th October, 2007
Regards,
Manowj
|
|
|
|
|
No, you can't disable the window Close button through Javascript
Regards - J O N -
|
|
|
|
|
I am New to .net , in my project I am using one dropdownlist and using its (selecteditem.text)value and selectedvalue both.Now the problem is that
selectedtext i.e stnno is unique but its selectedvalue is date and not unique
if i select the third value from dropdown whose postback=true then it is returing the value of first record because the selectedvalue i.e date is same for both the index what can I do.????????????
Ankur
|
|
|
|
|
Not sure I follow 100%, but if your control is databound, and you bind on postback, your selection will be lost. Put your DataBind code inside a if(!IsPostback) block
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
The values of the options are supposed to be unique. The only thing that is sent back from the browser in the postback is the value of the selected option, so if the values are not unique, you can't know which option was really selected.
If you really can't use unique values, you have to handle the detection of the selected option all by yourself. You can put a Javascript in the onsubmit event in the form, that gets the selectedIndex from the html element that the dropdownlist generates, and puts it in a hidden field.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi all,
I m using .net 1.1. I m creating FormsAuthenticationTicket at login page. I have done Application_AuthenticateRequest() in Global.asax. But I cant get userName at one page , which I m getting by following code
<br />
lblStaffName.Text = HttpContext.Current.User.Identity.Name;<br />
But I get this value blank("").......
Please tell me where I m wrong....
Thank you.....
This time will also pass.....Remember this in bad days of Life.
Keep Smiling
|
|
|
|
|
V H Shah wrote: But I get this value blank("").......
I think in user system there are no users....for that reason it is showing blank....
one thing tell me is your system having any users?
Regards,
Sandeep Kumar.V
|
|
|
|
|
how to encrypt a value passed through querystring.that means in mail ids if we login then an encrypted code is formed,after we logout and agian login then another encrypted code is generated .how is it possible.please send the source code for encrypting an id using random numbers.
Sreejith
|
|
|
|
|
|
Hi,
Let me know the advantages of using ObjectDataSource in ASP.net2005 web applications??
performance wise is it gud??
Be very grateful for any advice.
Regards
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
The answer to this kind of question depends on the developer how they would like to program their application. Using ObjectDataSource eliminates most of the coding but I believe that this ObjectDataSource is meant for beginners not for the developers who are proficient in writting ADO.NET code.
Regards - J O N -
|
|
|
|
|
Thanks for your reply.
Let me its advantages in 3 tier architecture
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
u can use objectdatasource to enforce 3 tier architecture.
u can create classes in the business layer and then link methods in those classes with UI controls like gridview and display data in them.
CST
|
|
|
|
|
window.onbeforeunload=callThisFunction
function callThisFunction()
{
alert('hi');
}
Now all events are fired. but i want only for window close, back and forword browsers button
|
|
|
|