So my tree loads and looks just fine and I can get it to workish. When I click on the expand button, the children load just fine, but the loading box doesn't go away. But if I click the check boxes next to the expand button it makes the loading box go away and I can then expand or minimize once more. But again when I click the expand it hangs up until I check and uncheck one of those boxes again. Can anyone point me towards what could be causing this. I don't know if maybe its just a setting or maybe I need to load my Data dynamically or something. If someone could just point me in the right direction I would be grateful.
I found out that I am getting an error now, but I have to head home for the day. Ill post the error and maybe that will help you guys help me.
Uncaught TypeError: Cannot read property 'settings' of undefinedVM105:346
delegateVM105:1240 (anonymous function)VM93:5109
jQuery.event.dispatchVM93:4780 elemData.handleVM93:5021
jQuery.event.triggerVM93:5344 jQuery.event.simulateVM93:5595
handlerVM138:742 _aspxSetInnerHtmlVM138:8958
_aspxCreateClass.ProcessFullCallbackResultVM138:8925
_aspxCreateClass.ProcessCallbackResultVM138:11431
_aspxCreateClass.ProcessCallbackResultVM138:8767
_aspxCreateClass.OnCallbackVM138:5213
_aspxCreateClass.ProcessCallbackVM138:5198
_aspxCreateClass.DoCallbackVM138:10647 $.ajax.successVM140:3062
jQuery.Callbacks.fireVM140:3174 jQuery.Callbacks.self.fireWithVM140:8249
doneVM140:8792 jQuery.ajaxTransport.send.callback
Related
how would I go about clicking a button ina web page loaded in the webbrowser component? I want to click a button and display the resulting page in the webbrowser. I have googled and can not find the answer; can anyone help?
If the element has an ID, you can use this;
webBrowser1.Document.GetElementById("id").InvokeMember("click");
Although one direction I used recently is to find out the url that the button click takes you too, and navigate to that. This may not work for all sites..
Actually, I am have designed an application using WindowsUI(MetroUI) with TileContainers.
Now,My problem is that : I have a text in TextBox and I have selected the text and want to copy it with mouse right click other than ctrl+c.(Because my clients are not aware of the shortcuts).
So,When I'm rightclicking on the textbox with mouse,the TileContainer WindowsUIButtons are sliding from top of the page.
Is there any chance of getting that?
sorry for my bad english :)
If I understand your question correctly then you could just use a Context Menu.
See this URL for a step by step process on doing exactly what it sounds like you are wanting.
Hope this helps.
I am working with a website that has javascript that does some changes on the page load. However, when I load the page and handle the DocumentCompleted event, this change isn't there. If I then continue paste the DocumentCompleted event, I can see the change happen. However I need this change to happen during DocumentCompleted so I can check some things.
Is there an other event I can subscribe to, or a way to cause the webBrowser to do all the javscript on page?
Edit: This is what I am talking about.
I loaded a sample page just to show you, and clicked the submit button with all fields empty to generate an the error.
Here is the result:
http://s8.postimage.org/zfv6stcar/sfsdfsdfds.jpg
Now if I take the HTML at that precise moment from that WebBrowser control, and render it somewhere else, those errors go away. The same thing happens when the server sends back those errors. If I handle the DocumentCompleted event and take the html, it isnt there. But after the event, it shows up in the control.
Hope you understand, it's hard to explain.
The problem seems to be that the DocumentCompleted event is being fired before the javascript. You should do some reading on how client side/server side things function.
One option is to make a separate method for the DocumentCompleted event and call it form the javascript after it has been completed. This would get the sequencing of these events working properly, but is not very ideal.
Alternatively, you could call the javascript code at the beginning of your DocumentCompleted event. The link below gives a pretty good explanation of how to go about that.
http://forums.asp.net/t/1117189.aspx/1
Personally, I would avoid using javascript and do the validation on the client side .NET, but I don't know enough about the website to really say.
EDIT:
This should be the script you are looking for. Alternatively here is a thread related to your issue. Sorry I don't have the exact code as I don't have a project to test this on.
http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscript.aspx
Calling JavaScript Function From CodeBehind
RE-EDIT:
What is happening on the link you provided in the comments, is that each textbox is calling some javascript as well as the submit button. The best way to examine this is using the "Inspect Element" in the right-click menu on Google Chrome. For example, doing this on the textbox would show that it is registered with a few events:
onfocus="$('f_tip_Username').style.display = 'inline'"
onblur="$('f_tip_Username').style.display = 'none'"
onchange="$('f_err_Username').style.display = 'none'"
The first the element with the ID 'f_tip_Username', sets the display style of that element to inline (visible).
The submit button calls the following:
onclick="return o_edit_profile_form.validate()"
Doing a find on "o_edit_profile_form" in the source code, you can find the exact javascript location that is being called. Enjoy!
FINAL EDIT (hopefully?):
Follow these steps: go to your site, right click and go view source. Do a find for "f_tip_Username". This is the ID of one of the div tags being used. The third entry of it, should be a "div tag" that is used under the first textbox to warn of "min 3 characters".
You'll notice above that in the code is a input type "text" with the Name "Username". Notice the three events it has registered in it:
onfocus="$('f_tip_Username').style.display = 'inline'"
onblur="$('f_tip_Username').style.display = 'none'"
onchange="$('f_err_Username').style.display = 'none'"
These either hide or make visible, the div tag we found (f_tip_username) and also a separate div tag (f_err_Username) which is the error message div tag. Let me know if you are not able to find these in the source. Follow the steps I provided and you will find it in the "view source" OR in the DocumentText.
I am currently building a test harness for the company I work at. I have experience both with C# and WatiN and have never encountered the issue I am now having.
Below, is a snippet of the markup for the page giving me the issue:
<div id="toggle1" class="NavLayout toggle">
<span onClick="toggleMenu(1, false);">
<span id="toggletext1">Quote Processing</span>
</span>
</div>
As you can see, I have a div, 2 spans and an image. I am using WatiN to try and click the image, that will then expand the menu, exposing yet another layer that I will need to click something else on. The problem I am having is in getting the 'Click' to happen. From what I can see in the snippet, it seems to me I need to be able to click the event, but cannot 'find' it with the code.
Any help out there to be had?
I have also had issues with clicking on certain elements.
I've run into issues where I could only click on an element if it was highlighted by mousing over the element.
Since I cannot see your code snippet, I can't tell if there is any javascript that deals with mouseover associated with the image, but if there is, you can try the following:
img.FireEvent("onmouseover");
img.FireEvent("onmousedown");
img.FireEvent("onMouseup");
You might also might want to try img.FireEvent("onclick") as well.
These are all guesses, since I can't see your code. It's also possible that rather than clicking on the image element itself, that you may want to try clicking on the parent object.
EDIT:
Ok, now that I can see your code, it appears that you should fire an onClick event against the span with the 'onclick' code in it.
I don't see an image listed in your code snippet, but this code should call the parent of the lowest level span.
Watin.Core.Span span = browserinstance
.Span(Find.By("innertext", "Quote Processing"));
span.Parent.FireEvent("onclick");
The DOM content that you intended to post is not visible. You might want to edit your post and check if it is visible.
In order to click on images
Watin.Core.Image img = browserinstance.Image(Find By Constraint);
if (img!=null and img.Exists)
img.ClickNoWait();
OR
img.FireEvent("onclick");
I want to know what exact events fires when ASP.NET page load event fires. As i am using a lightbox in which some insertion is going on and after insertion i want that the parent page reloads with the new value loaded in gridview which i have in parent page. In light box page i added javascript event of parent window reload but sometime it works sometimes it reloads but after refresh newly insert values shows, please help me what i am doing wrong thanks in advance.
I think you have isPostBack check in parent page. Try to remove it for test.
here is asp.net page lifecircle
http://msdn.microsoft.com/en-us/library/ms178472.aspx
I'm trying to understand your question. Am I right in thinking that you are calling window.location.reload() in javascript but when the window reloads, the new inserted content isn't always there?
It sounds like you either have a caching issue or you need to insert a brief wait interval before you reload the page. Does this help you?