|
You should use RegisterClientScriptBlock instead. When you do a Response.Write the code gets written on top of the page and that affects the font sizes. When you use RegisterClientScriptBlock , the code goes into the HTML tag.
This code is for Asp.Net 2.0, if your using Asp.Net 1.1 then you will have to use Page.RegisterClientScriptBlock
StringBuilder strScript = new StringBuilder();
strScript.Append("<script language="javascript">window.open('FileToOpen.aspx');</script>");
ClientScript.RegisterClientScriptBlock(Page.GetType(), "subscribescript", strScript.ToString());
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
When you use javascript using response.write,
the javascript is written before <doctype...> tag
That makes the browser ignore the
doctype, and the page is displayed in quirks mode.
The solution suggested above is the best way to do it.
There is also a workaround:
write response.write(<doctype.....>) code before response.write tag.
don't know how good this solution is, but it works perfectly well.
|
|
|
|
|
Hi All,
I would like to Embed a Window media player inside a gridView.
Here is the Window media player tag in HTML
<object
id="mediaplayer"
classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http: activex.microsoft.com="" activex=""
="" controls="" mplayer="" en="" nsmp2inf.cab#version="5,1,52,701"
STANDBY="Loading" microsoft="" windows="" media="" player="" components..."
type="application/x-oleobject">
<param name="fileName"
value="http://hotwired.lycos.com/webmonkey/radio/WMRadio7.mp3" />
<param name="animationatStart" value="true" />
<param name="transparentatStart" value="true" />
<param name="autoStart" value="true" />
<param name="showControls" value="true" />
How is that possible?
Thanks for your help.
|
|
|
|
|
I think it is possible. What error are you getting??
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Thanks for your response.
Here is the Error :
System.Web.UI.Webcontrols.datacontrolFieldCllection must have items of type 'System.UI.webControls.DataControlField' 'Object' is of type system.web.ui.objectTag'
I am just trying to put object code inside asp:griedview and coulmn template.
Thanks
|
|
|
|
|
Hi,
We got to convert a doc to pdf format for that we installed a printer and the conversion works fine
Now the same should be implemented through webservice, so we have sent the name of the file and the printer to the webservice and then print the document however the operation fails!
Are there any steps to be taken when implementing the same through webservice?
When checked the printer it shows different owner and port when trying to print through web service, is there a way that i can change these settings?
Thanks,
gauthee
|
|
|
|
|
Maybe you are having a permissions problem? by default, the web service runs as user ASPNET on local machine. Probably that ASPNET doesn't have enough permissions to run the print job. What you could do is make ASPNET impersonate another user who has permissions to print...or you could give ASPNET those permissions. Or am I missing something?
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
thanks for the reply talal.
all permissions are given, to the printer aspnet is added with full permissions.
is there anything else that i missed?
gauthee
|
|
|
|
|
hmm, well I don't know. I haven't done that before. How are you printing? Are you calling an application from your web service or is it the web service that is printing (from inside the code)?
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Printing - there is a printer driver installed in the machine i.e. novapdf printer
all i do is create a word object and use the print method to print the doc, prior to this i would set the printer as novapdf printer thats it!
gauthee
|
|
|
|
|
I want to encrypt an URL so that user cannot see the query string values and all that.
I think it can be done by writing some codes in Global.asax file but I cannot do so.
Help me out.
Thanks in advanced.
Divyesh
|
|
|
|
|
|
sorry buddy that url does not exists.
thank you
divyesh
|
|
|
|
|
|
The following code,
PageDetails.Request.QueryString.ToString()
Returns the following.
NewsID=66NewsID=66
Any ideas anyone?
|
|
|
|
|
I take it the newsId only appears in there once ? Why are you calling ToString ?
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 query string is http://localhost:49614/WebSite4/Default.aspx?NewsID=66
Will ToString() have any affect? ie a doubling effect?
|
|
|
|
|
Calling the ToString() method will return a string representation of QueryString which is a NameValueCollection . I would guess that you have passed the same parameter twice to the page URL with the same value?
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
hum? I don't think it's strange. "NewsID=66NewsID=66" is something that you pass it to this page..
Steps to reproduce this ~
#1. Create web project
#2. Write the following code in Page_Load.
string a = Request.QueryString.ToString();<br />
Response.Write(a);
#3. Run the application. (Observe: You will see nothing since there is nothing in parameter.)
#4. Type Like that "http://localhost:49614/WebSite4/Default.aspx?NewsID=66NewsID=66" in browser. (Note: Website4 should be the name of your website.)
You will see the following in your page.
NewsID=66NewsID%3d66
If you use this codeRequest.QueryString.ToString(); , you will get all parameters. If you wanna get individual one, use like that "Request.QueryString[0] "
Let me know if I miss something..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
The query string is as follows
The query string is http://localhost:49614/WebSite4/Default.aspx?NewsID=66
As copied from the URL
|
|
|
|
|
Sam Heller wrote: The query string is http://localhost:49614/WebSite4/Default.aspx?NewsID=66
No.. I have tried with your querystring. (Environment: Windows Vista, Visual Studio 2005 C#) I got only
NewsID=66 . I suggest you to create new project and try again... If you still getting this issue, show us the sample code.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
How to access the value in a textbox given in a particular page to another page?
|
|
|
|
|
If you are posting it, then access via Request.Form["textboxname"] .
|
|
|
|
|
You can put the data in the session, put it on the URL, or use a cross page postback ( I never use those, they are a hack )
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 )
|
|
|
|
|
Hi All,
I want to redirect from aspx page to html page for this html page i'll pass query string parameter like this
www.test.com/welcome.htm?login=sanju
how to get querystring parameter value in html page.
Thanks,
Dharani.
|
|
|
|