When I create a form, I try to make accessibility a top priority, but the output from asp .NET negates some of this. For example, when I set a label tag for an input tag, I create it a such:
I have a custom control which is rendered as a hyperlink:
Public Class TestControl Inherits System.Web.UI.WebControls.WebControl Implements IPostBackEventHandler Public Sub RaisePostBackEvent(ByVal eventArgument As String) Implements System.Web.UI.IPostBackEventHandler.RaisePostBackEvent Trace.WriteLine("Hyperlink 1 clicked") End Sub
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) writer.WriteLine("<a href=""{0}"" id=""{1}"">Hyperlink 1</a>", _ Page.ClientScript.GetPostBackClientHyperlink(Me, "Hyperlink 1"), _ Me.ClientID) End Sub End Class
This works fine. It also works nicely when put inside an UpdatePanel: Only the UpdatePanel is refreshed, no full postback is performed.
Now I would like to output a second hyperlink in the Render method. If I use the same id (Me.ClientID), everything works nicely, but this obviously results in broken HTML (no two controls are allows to have the same id attribute). If I use different client IDs (like Me.ClientID & "_1" and Me.ClientID & "_2"), a full postback is performed when the hyperlinks are clicked.
Is there some way to tell ASP.NET AJAX: "All postbacks of the following client IDs should be done asynchronously: ..."?
I've been watching a video on Scott Hanselmnn teaching MVC 2 tricks/tips. He mentions how MVC 2 by default uses ASP.NET Web Forms view engine to render the output of the views; he mentions that the web forms view engine is a little slower than it could be for MVC 2 since it generates a control tree and then outputs the HTML to the page (I hope I said that right).
I was wondering what he meant by web forms generating a code tree before outputting the HTML to the page. Does anyone have insight on the view engine of Web forms and the steps of the rendering process works for ASP.NET and MVC2?
I have a requirement to automate the testing of .net application that generates some output files in pdf or html based on account number. How can I automate it to compare the results from DEV environment and the production environment? What is the best way to do so?
I have a Web Deployment Project in my solution. The solution consists of the MVC2 App and another Class Library.
In the Web Deployment Project properties I have the Merge all outputs to a single assembly option ticked and I have given it a name.
When I look in the bin folder I have all my reference DLL's from my MVC app, a DLL with the name of my MVC project and then a DLL by then name I gave it when choosing the Merge all outputs to a single assembly option.
I imagined this option would create 1 DLL not all DLL's plus another one.
how I can add outputs to my vb.net functions? The reason for this is that I have functions which return data tables for grid views. But I also want to pass a return value back to the calling routine, so that it knows whether the function succeeded or failed. It would also be good to pass strings back too, in addition to the returned data table.
I am developing a software that uses number precision, but I have this problem, it happens that when I take a string to convert to double it outputs me with a different culture.
For example I use
Convert.ToDouble("4089.90"); // it outputs 40.899,00
Is strange cause in my computer it works OK but on the client's PC (with the same culture in regional settings) shows me the latter output. I know I can fix it using
But there is a lot of code in the program using "Convert.ToDouble" and I wouldn't like to change all of it, on the other hand I want to understand why this happens.
When a .NET server control is rendered in a browser it is rendered as a html control. Then how a browser differentiate between a server control and a html control. If the two control rendered as same then how server side events fire for a server control? If u say by using runat="server" attribute then also we can add runt="server" for html controls to work at server side... so then how these are recognized?
I have a multi view which contains a view which contains a panel. the name of this panel is "Panel1"I have the following code and my HTML does not display in the rendered page. Any idea why this isn't working, i must be doing something wrong? sw = simple html statement, any would produce same result.
Setting value in html control in code behind without making server control
<input type="text" name="txt" /> <%--Pleas note I don't want put runat=server here to get the control in code behind--%> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
Code behind
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //If I want to initlize some value in input, how can I set here } } protected void Button1_Click(object sender, EventArgs e) { Request["txt"] // Here I am getting the value of input }
I have created a web user control I want to change the iframe' src value when the user click on the link but the problem is that I dont have access to iframe inside the page from web user control I think there is a way because my control is in the page they have some relation perhaps I like to find something like this :
I added a Input (Text) control in my web form and turned it into an HTML server control so its an instance of HtmlInputText class.
If I double click on the control It only adds a OnClick event handler method inside the script tags in the HTML doc of the web form but how to I get to handle its Serverchange event exactly? does VS.net 2008 has no ability to auto wire up the event to the control, do I have to manually wire up the event handler?
i would like to know what exactly the difference between Html control and asp.net web control. why do we need these two types of controls?i have placed one html input text ,html button and asp.net text box AND ASP.NET BUTTON on my web page
I'm just starting out with WebMatrix and would like to know how to style a @Html.TextBox("email") and @Html.Password("password") control? I've tried (in my CSS file):
.email{ /* styles here */ } .password{ /* styles here */ }
But that has no effect at all. How can we style these types of controls?
I have an html control (not a server control) like textarea. How can I get the value in this control from the server side when I cause a postback by clicking on a button, without writing the value in the url.