I want to mock ASP.NET 3.5 behavior in order to unit test my WebControls: I want to test how they perform with mock data with existing system of events. Basically I want to test generated result HTML based on input mock data.
How to do it?
I looked into NMock, but it doesn't suit my needs for 2 reasons:
It just runs ASP.NET server in...
I am writing a custom composite WebControl and want to expose styles of child controls it encapsulates to the ASP.NET designer. The code I currently have is similar to the skeleton below (which for simplicity only has one child control).
With the code below, I can see property "ChildPanelStyle" in the designer, but when I try to modify...
Hallo,
I have a WebBrowser control webbr initiated and a page loaded. I fill out the fields on the page's form through parsing:
HtmlDocument htmldoc = webbr.Document;
and so on ...
Then:
webbr.Url = new Uri("http://www.host.fr/cherche?q_que=%2Barg1+%2Barg2");
htmldoc.GetElementById("Submit_Btn").InvokeMember("click");
S...
I'm creating my own CompositeControl: a collection of MyLineWebControl and a "add" button. When the user press the "add" button, a new MyLineWebControl is added.
In CreateChildControls(), I run through my model (some object MyGridOfLines which has a collection of MyLine) and add one MyLineWebControl for each MyLine.
In addButton.Click,...
I have a web user control, CreateQuestion.ascx, in ASP.NET. I want an event "QuestionAdded" to fire when a specific button is clicked.
I don't want to send any data, I just want to know WHEN the button is fired.
My implementation:
CreateQuestion.ascx:
public event EventHandler QuestionAdded;
protected virtual void OnQuestionAdde...
I've searched the site and I cannot find a solution for my problem, so apologies if it's already been answered (I'm sure someone must have asked this before).
I have written a jQuery Popup window that I've packaged up as a WebControl and IScriptControl. The last step is to be able to write the markup within the tags of my control. I've...
In the XHTML for a page I have:-
<asp:Button ID="bookNowButton" runat="server" CssClass="bookNowButton"
OnClientClick="showHideLoggedInDiv('<%=bookingFormDiv.ClientID%>')" />
This breaks. I need the correct syntax or method to insert the bookingFormDiv.ClientID into the control.
What needs to be done?
...
I have to serialize several objects inheriting from WebControl for database storage. These include several unecessary (to me) properties that I would prefer to omit from serialization. For example BackColor, BorderColor, etc.
Here is an example of an XML serialization of one of my controls inheriting from WebControl.
<Control xsi:ty...
Since WebControls inherit from Control which implement IDisposable. Is it necessary to call Dispose or wrap these WebControls in using statements to prevent memory leaks or does ASP.NET automatically handle this?
...
I'm rewriting a web application to ASP.Net 4.0 and have included a Menu control (bound to a SiteMap file, naturally). While I'm liking the new RenderingMode property, I'm hating the fact that it automagically includes some javascript at the bottom of your page to animate the menu.
My preference would be for greater control using jQuery...
I have a LinkButton in a web control and I want to bind the event at the page where I use this web control.
LinkButton's href attribute is renderedas below.
javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl00$CoreContent$Content$scale1", "", false, "", "/thema/fi/product/reviews.aspx", false, true))
It ...
Nice!
Now I can get the selected text with my IE plugin.
Now I have another problem.
How to grab the selected Image on the webcontrol/IE????
Thanks I really appreciate the help.
...
Hello everyone.
I am very sorry for the long title but I really didn't know how to be more self explaining than this.
The problem I have is this:
I designed and developed a WebControl which consists in a simple set of elements that, combined togheter in the simplest way, defines a custom button. This control is the one I would like to u...
I have a problem with the default value attribute.
When I add my control to page at design mode, default value does not work. This is my code:
[DefaultProperty("Text")]
[ToolboxData("<{0}:KHTLabel runat=server key=dfd></{0}:KHTLabel>")]
public class KHTLabel : Label ,IKHTBaseControl
{
[Bindable(true)]
[Category("Appearance")]
...
I need a Webcontrol (System.Windows.Forms.WebBrowser) in my Webservice, because I have to calculate distances between coordinates and for that I'll use Google Maps (geocoder). With the Webcontrol I could execute my javascript code to calculate the distance (WebControl.Document.InvokeScript).
Is there any way to get a webcontrol in a web...
is asp.net compiler change the name of public methods that declares in "web control" ???
...
Do you know any ASP.Net controls like Spread for ASP.NET that can render Excel like pages that has built-in formula evaluation?
...
I have an application that uses an embedded IE through the Windows Forms WebBrowser control. I want to embed some .NET controls into the HTML page.
There is old support (since .NET 1.0) to use a special classid in an <object> tag (dllname#controlname) but through experimentation I have found that it only works if the dll is served over ...