|
hi.
i have web page that contain a button. here is button's code:
<button type="submit" class="btn" style="width: 200; height: 22" onclick="setAction(method,'save');"><br />
<img border="0" src="/evocher/html/image/blt_01.gif" width="13" height="11"<br />
align="absmiddle">Register</button>
i write this code to obtain button:
mshtml.HTMLDocument doc;
HTMLInputElement registerButton = (HTMLInputElement)doc.getElementsByTagName("button");
but it generate runtime error, Invalid TypeCasting.
how can obtain this button?
|
|
|
|
|
getElementsByTagName returns a collection of objects. You try to treat it like a single object. I don't know the exact type of the collection, but I would assume that you need to cast it to something like a HTMLCollection
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
try
Button btn = (button).FindControl("the control Id goes here );
|
|
|
|
|
Unfortunately not. That only works for windows forms. This uses DOM, which is completely different. Also, you don't call FindControl on (button); that assumes you already have the Button instance. You call it on the Button's parent control
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
yes you are write i miss typed it it should be this. meaning that find control from this page.
|
|
|
|
|
is there any other solution to get button ?
|
|
|
|
|
I don't know. To be honest, casting getElementsByTagName to the correct collection, and then iterating until you find your button sounds like a fairly efficient approach
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
I need to refresh my parent page from pop up using __doPostBack in javascript could any body tell me how i tried to googlize it but the information was not that helpful
|
|
|
|
|
I don't know how to do it using __doPostBack, but I imagine it would look something like this:
window.opener.location.reload();
You would probably get better results by asking this question in the Java forum though.
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Hi All,
I am creating windows app, with MVP architecture.I added a textbox and button to the window.xaml, so that my intention is to browse a folder on button click and display the path in the textbox.
If I select MyDocuments in browse click, then the entire path (C:\\Documentsandsettings\....\MyDocuments) should be displayed in the textbox.
I am new to MVP and as of now
1 . window.xaml with textbox and button
2. presenter class (windowpresenter.cs)
3. Interface class (Iwindow.cs) are created .
But, I am unaware of how to link these controls and how to use publish and subscribe these controls.
Please kindly help me in doing this.
Thank You,
Ramm
|
|
|
|
|
Hi To all
I`m very new to the programming and got stuck.
So i`ve been trying to write a program using Windows Form which include several different panels on. User can choose between which one is visible.
on each form there are few pictureboxes and my problem is .....
when you swich between them in the runtime it`s not smooth enough user can see loadning frames of these picture boxes for few miliseconds this is really annoying.
Is there any easy way of loading it in the background and show it after its ready or something ??? I started reading about threads etc but at the moment its quite difficult, i will be gratefull if someone could explain it with an example
Thanks in advance
Dims
|
|
|
|
|
You could call pictureBox1.SuspendLayout(); , load your image into the PictureBox, then call pictureBox1.ResumeLayout(true); to update the layout.
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
right i`ll try that but i forgot to tell you that on the form is background 800x600 bitmap so maybe that is the reason that is so slow.
|
|
|
|
|
It doesn't really matter, except that you might want to call SuspendLayout and ResumeLayout for the form as well. That might speed things up slightly, but I've not tested it.
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
It`s not working for me, what i`ve noticed is that all the panel as the user switches between do same thing whether there are only labels or pictureBoxes
so i`m assuming that there`s the problem with bitmap on the background of the form.
panels they are all set up as transparent.
any ideas??
|
|
|
|
|
Hi,
if your app is slow, try and figure out why and fix it. Are your images way too large and getting downscaled all the time? are you using some fancy transparancy stuff?
And did you look into double-buffering? you might try and set DoubleBuffered true. That does not really solve performance problems, it does hide some of its visual effects though.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hi everybody.
I have an C# desktop application, it support multiple instances.
but in my case, my application get 10-15 sec to load and if in between second instance get started, it will crash.
So i wish multiple instance application but even if there will be successive two double click to start application, second ,third instance should wait a while..
I have tried mutex but i have no detail idea of mutex.
Pls give me a way to do it
Thanks in advance.
|
|
|
|
|
Just a quick point - it'd be better to avoid crashes when multiple instances start by addressing that rather than delaying start up. Why does it crash?
You may be able to get a more granular critical section that way. Failing that then a Mutex probably is the way to go.
Regards,
Rob Philpott.
|
|
|
|
|
Hi Rob ,
Thanks for reply/
I am not able to find a reason for crash but it may be reading/writing file at a same time.
Any idea about mutex.WaitOne(...)
Thanks
|
|
|
|
|
Anybody know where I can find a decent Class Generator that will generate classes for me based on Access 2007/2003 tables? Preferrably Access 2007.
|
|
|
|
|
Such auto-generated classes would likely be useless. There is no substitute for doing it yourself.
|
|
|
|
|
Well I've actually downloaded a class generator that works with Access 2003 and it works perfectly, generated all the classes for me together with methods for adding, updating etc.
|
|
|
|
|
Can you state where you downloaded the class generator or even just it's name? I too am looking for this kind of product.
|
|
|
|
|
|