|
Mundo Cani wrote: Unfortunately, the problem is getElementById does not return an element.
That is very strange.
As an exercise I just swiped the code in my rely from the <html> to the </html> and put it into a new document in notepad.
I saved the document as test.htm and then clicked on the saved document. A browser window came up and the control worked as intended. I didn't add or take anything away but just used the code posted.
Try it and see if you get the same results.
There is no problem with getElementById. I use it all the time on my web pages.
|
|
|
|
|
I got it working. I was confused with the difference between client-side and server-side controls. Thanks!
Ian
|
|
|
|
|
Mundo Cani wrote: there is no mispelling... I copy/pasted the id
That doesn't help, as you are copying the id that is used for the server control. The getElementById method is using the id of the html element that the control renders, and if you examine the rendered html code (view source in the browser) you will see that they are not the same.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
When a control is in a container (like a content control of a master page), the id is prepended with the id of the container.
Use the ClientID property of the control to get the id that you can use in client script, or view the source of the generated page to find out the generated id.
---
single minded; short sighted; long gone;
|
|
|
|
|
Ian
When control is in master page then the client side rendering of the webpage automatically genrate Id's for the server side control you need to traverse all the elements in the content regardless of using "document.getElementById('selectDisplay');" coz it will definetly not work
Thanks
Sarfaraz Nazir
Solution Developer
Accentys Inc
|
|
|
|
|
Thanks for your help!
Ian
|
|
|
|
|
Hi Guys,
Is there a way wherein I can place the "text" of Linkbutton in center position?
Because what happened was, when I removed the underline the text is automatically adjusted to top position.
What I want is a LinkButton with transaparent background color, no borders and the text should be in center position (valign = center).
Could this be possible?
Thanks in advance Guys.
hifiger2004
|
|
|
|
|
if you put any tags in your server control that are not recognised by the framework, they get passed through to the client. so, you can add a style tag, or any other tag you like that pertains to the control that gets rendered.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 Christ,
I wanted to follow your advice, but with regards to style tag I can't picture out if how am i going to do it. I hope you will send me a sample of Linkbutton that has a style tag.
What I need is a simple asp.net LinkButton control with text "Search" and will displayed with valign = "center" or "middle"
Please see this link - http://cvd.harnesstheweb.com
If your browser is IE6 or IE7, you will noticed here that the menus on the header are not in center position. This is because the LinkButton control has no valign property.
Do you have another idea on how to move the text vertically to the center of the Linkbutton?
hifiger2004
|
|
|
|
|
Hi
I am working with AJAX Panel Collapsable panel extender. The Panel which is to be collapsed/Expanded using AJAX panel Extender contains one custom control, containing 3 Radio buttons one of them is set checked through a javascript function when page loads.
I have kept the default property of AJAX collapsable panel as Collapsable.
But problem is that when page loads, collapsible panel gets collapsed but it resets the radio buttons in custom control. i.e. First radio button does not get checked.
Script for Collpsable panel is as follow.
<ajax:collapsiblepanelextender id="cpeSOP" runat="Server" collapsecontrolid="pnlCollapsable"
="" collapsedsize="0" collapsed="True" collapsedimage="~/public/img/arrowRightWhite.gif" expandcontrolid="pnlCollapsable" expanddirection="Vertical" expandedimage="~/public/img/arrowDownWhite.gif" imagecontrolid="Image1" suppresspostback="true" targetcontrolid="pnlSearchCriteria">
I want to call some javascript code when the panel is Collapsed or Expanded.
Is there any way to track Collapse / Expand event (client side / server side) of AJAX Collapsable Panel Extender ?
If so it will be my pleaseure to know this as early as possible, as i am fighting on this problem since long time.
Thank you.
Sarang Deshpande
|
|
|
|
|
in my app, i want to retrieve images from database for different users currently i m doing this with filestream but it not working properly so if there any other idea plz help me.[i m using c#]
|
|
|
|
|
If you're using C#, you are probably using ASP.NET, although it sounds like a general C# question to me.
What do you mean by 'not working properly' ? Obviously, there's no reason for it not to work if it's done right. If you explain your approach, and show some code, perhaps we can help.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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
thanx for response
here my code:
string strconapprove = ConfigurationSettings.AppSettings["connection"].ToString();
string strcmdapprove = "select * from coc_prayer_request_pending where ID='" + idi + "'";
SqlConnection conapprove = new SqlConnection(strconapprove);
conapprove.Open();
SqlCommand cmdapprove = new SqlCommand(strcmdapprove, conapprove);
SqlDataReader rd;
rd = cmdapprove.ExecuteReader();
if (rd.Read())
{
//picture#1:
string root = Server.MapPath("~");
try
{
byte[] barrImg1 = (byte[])rd.GetValue(rd.GetOrdinal("Picture"));
string strfn1 = root + @"\iimage\" + rd.GetValue(rd.GetOrdinal("Picture")).ToString() + ""+idi+".gif";
FileStream fs1 = new FileStream(strfn1, FileMode.Create, FileAccess.Write);
fs1.Write(barrImg1, 0, barrImg1.Length);
fs1.Flush();
string strpath1 = "~/iimage/" + rd.GetValue(rd.GetOrdinal("Picture")).ToString() +""+idi+ ".gif";
//thumbnail #1
if (fs1.Length != 0)
{
h1.Visible = true;
System.Drawing.Image img1 = System.Drawing.Image.FromFile(Server.MapPath(strpath1));
System.Drawing.Image thumbnailImage1 = img1.GetThumbnailImage(50, 50, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallBack), IntPtr.Zero);
MemoryStream imageStream1 = new MemoryStream();
thumbnailImage1.Save(Server.MapPath("~/image/thumb"+idi+".gif"), System.Drawing.Imaging.ImageFormat.Gif);
byte[] imageContant1 = new byte[imageStream1.Length];
Response.Clear();
h1.ImageUrl = "~/image/thumb"+idi+".gif";
h1.NavigateUrl = "show_picture.aspx?id=" + idi + "&type=pp&name=prayer&profile=aapprove";
fs1.Close();
}
else
{
h1.Visible = false;
}
fs1.Dispose();
}
catch (Exception ex)
{
h1.Visible = false;
}
conapprove.Close();
//problem is that some times it gives the error of GDI.
or outOf memory.
|
|
|
|
|
What's the error ? One possibility is that you never dispose of your resources, and if you open an image you opened before and has not been garbage collected, the file could still be locked.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
This could be the problem, although I don't know what your path and file names are:
string strfn1 = root + @"\iimage\" + rd.GetValue(rd.GetOrdinal("Picture")).ToString() + ""+idi+".gif";
string strfn1 = root + @"\image\" + rd.GetValue(rd.GetOrdinal("Picture")).ToString() + ""+idi+".gif";
You spelt image as iimage. All other places in code you spelt it correctly.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
code is not a problem frnd. that's a folder and i think folder's name does't make a problem
|
|
|
|
|
I was just double checking. What is the error you are recieving, you never specified that.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
hi,
i want to replace the message [Java Applcation]from the confirm box.
i have implmented a confirmation on a button click as shown below.
Button1.Attributes.Add("onClick","return confirm(Do you want to quit?')");
Its working but im not able to edit the title of the popup window. If anyone have any idea or any alternative method than this..pls help me.
Thanks in advance
arun
|
|
|
|
|
arun rajappan wrote: any alternative method than this..pls help me.
As an alternative you could use a popup window in place of the confirm dialog.
|
|
|
|
|
Hi,
How can i provide reference path for a web application, I know that web app can get the references from Bin and GAC,but can i provide path other than BIN and GAC.
Warm Regards,
Mushq
|
|
|
|
|
If you have a special path you need to use perhaps you should consider putting it in the web.config file? You could put it in appSettings.
Ben
|
|
|
|
|
Thanks for the reply Yes I found the appSettings in web.config file
can you please tell more about it that what should i insert inside AppSetting tag, so that special folder can be used for references.
Best Regards,
Mushq
|
|
|
|
|
You put an entry like this:
<add key="FileDirectory" value="c:\order\Working" />
And access it like this:
In .net 1.1 it looks like this.
string val = System.Configuration.ConfigurationSettings.AppSettings["FileDirectory"];
It is a little different for .net 2.0
Let me know if you need to know how that looks.
Ben
|
|
|
|
|
Hi all,
I built a website by asp.net, and now i want to test it's performance when many users access it.
And i know i must use a tool called "Thread test" to test performance. But i don't know where to download "thread test" tool.
Please give me a link to download "thread test" tool or some guide to test it's performance.
|
|
|
|