.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
sivanagamahesh
Post New Web Links

server controls inside asp:wizard, doesnt render html when step is not first..

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net
 

I have a server control which consists of a gridview with custom navigation&information capabilities and with javascript functions to highlight the selected grid items or highlight when mouse over event occurs.. (full tested outside asp:wizard)

I'm trying to use that server control inside a template wizard step, when I drop such server control in the first step of the wizard everything goes ok.

When I insert even a blank step previous to the step which contains the server control, the javasript code of the server control is not rendered at all, the page doesn't fail during load but until I go with mouse over an item of the grid for instance.

When I check the rendered HTML I can see no HTML, nor javascript events of this server control where rendered, neither the implementation nor calls to javascript, but even rarer what is there visible in the grid for ie, even the other components of the server control, are not in the "view source code" content.  

I seems it was sent to the client, even showed, but truncated in some phase..

Thanks in advance for your comments,

Louis.




View Complete Post


More Related Resource Links

Render controls from html string

  

Iam getting the below string in a variable"result" after xslt tranformation.
if i do Page.ParseControl(result) iam able to render controls to the page.
But the requirement is different.
I have 4 place holders in that aspx page.I need to bind div id="Section1" to placeholder1,
div id="Section2" to placeholder2 and similar the other two sections also  to the corresponding place holder.
Please help me out how can i loop and add controls to corresponding place holder.

result =

<div id="Section1" xmlns:asp="remove">
  <asp:Label id="lblSection1" runat="server" text="section1" />
  <asp:RequiredFieldValidator ErrorMessage="Mandatory Field-1" runat="server" ControlToValidate="txtNameSection1" />
  <asp:TextBox id="txtNameSection1" runat="server" />
</div>
<div id="Section2" xmlns:asp="remove">
  <asp:Label id="lblSection2" runat="server" text="section2" />
  <asp:RequiredFieldValidator ErrorMessage="Mandatory Field" runat="server" ControlToValidate="txtNameSection2" />
  <asp:TextBox id="txtNameSection2"

Rendering controls via Loop inside Render

  

I am creatin a server control where
some controls are being rendered inside  `protected override void Render(HtmlTextWriter writer)`

    writer.AddAttribute(HtmlTextWriterAttribute.Type, "button");
    writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "butto_Foo1");
    writer.AddAttribute(HtmlTextWriterAttribute.Value, "Button1");
    writer.RenderBeginTag(HtmlTextWriterTag.Input);
    writer.RenderEndTag(); //button
    writer.AddAttribute(HtmlTextWriterAttribute.Type, "button");
    writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "butto_Foo2");
    writer.AddAttribute(HtmlTextWriterAttribute.Value, "Button2");
    writer.RenderBeginTag(HtmlTextWriterTag.Input);
    writer.RenderEndTag(); //button       

This way buttons are rendered on design view as well. 
The problem is that number of buttons to render is dynamic based on data in xml file (even if the data was static, the number of button is about 12 and I don't think it is wise to copy paste the same code above 6 times...).

I thought by using loop

Sharepoint Server 2007 configuration wizard fails on step 6

  

I am installing Shareoint Server 2007 on a 2003 R2 server with 4Gb  Ram. the install works okay and ends with opening up of the Configuration Wizard. All goes smooth till Step 6 where is throws an exception error: Failed to register SharePoint services.

An exception of type System.ArgumentNullException was thrown. Addition exception information: Value cannot be null.
Parameter name: path


Accessing the different controls inside a GridView control

  
how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

Publishing SQL Server Database using Publishing Wizard : Tips & Tricks

  
We can use SQL Server Publishing Wizard to deploy our local Database to remote hosting server/production server.This feature is available in SQL Server 2008/VWD 2008.

Below is the complete step by step guide of this process.

Maintain HTML Radio Button Selection Inside GridView After Postback

  
Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

Database Export Wizard for ASP.net and SQL Server

  
A step wizard for ASP.net to export database objects to CSV, TXT, HTML, XML, or SQL. it guides users through a few simple steps to choose a database object (table, view, or query), select columns, and export the data in any of the standard formats CSV, HTML, XML, or SQL.

Embed Youtube inside Ajax Html Editor- problem

  

Hi,

When inserting a simple embed of youtube inside the ajax editor, on firefox and chrome problems occur. On the other hand on internet explorer 8 everything works fine. I found this solution http://www.nopcommerce.com/boards/t/4228/bug-in-ajax-html-editor.aspx . 

My question is where do I find the DesignPanel.pre.js ?


Thanks,

Roderick Vella


how to get an array of all the asp.net textbox control inside create user wizard control?

  

Hi,

How can I get all the textboxes inside a create user wizard control using getElementsByTagName().

Below is my JQuery code:

<script type="text/javascript">
        function addLoadEvent(func) {
            var oldonload = window.onload;
            if (typeof window.onload != 'function') {
                window.onload = func;
            } else {
                window.onload = function() {
                    oldonload();
                    func();
                }
            }
        }


        function prepareInputsForHints() {
            var inputs = document.getElementsByTagName("asp:TextBox");
            for (var i = 0; i < inputs.length; i++) {
                inputs[i].onfocus = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
                }
                inputs[i].onblur = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "none";
                }
            }
        }
        addLoadEvent(prepareInputsForHints);

    </script>


 

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
       

form feild hints are not displaying for textboxses inside create user wizard?

  

Hi,

I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			}
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";
			}
		}
	}
addLoadEvent(prepareInputsForHints);
</script>
span.

image inside custom server control

  

Hi,

I want to use an image inside a Custom Web server control ! 

Do I need to use Web.resources ? if so , how to do ?


Data Points: Report Controls in SQL Server 2005 Reporting Services

  

Reporting has always been one of the dark arts of development. The tools typically seem to do just enough to get you to a certain point, then leave you to find workarounds to solve more complex issues.

John Papa

MSDN Magazine July 2006


Asp.net server controls in BlackBerry Browser

  
The article Asp.net server controls in BlackBerry Browser was added by roopeshreddy on Monday, May 24, 2010.

Hi All,Some of the asp.net server controls(.NET 2.0) like DropDownList control, LinkButton etc., has postback property. When User clicks or selects these controls, a Postback will occur. Let us consider LinkButton control, which is extension of the HyperLink

Using Dynamic Property inside Html Helper with Razor fires an error

  

Hello,

I have the following with Razor:

@Html.GoogleAjax(View.GoogleAjaxKey, new String[,] { { "jquery", "1.4.2" } })

And the I get a strange error:

  'System.Web.Mvc.HtmlHelper<object>' has no applicable method named 'GoogleAjax' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.

What is strange is that it works fine using:

@Html.GoogleAjax("123", new String[,] { { "jquery", "1.4.2" } })

I tried the following code line:


@View.GoogleAjaxKey

And the key is displayed just fine so the problem is how I use the value of @View.GoogleAjaxKey into Html.GoogleAjax.


Do I need to change something on my Html Helper? Here it is:


    public static MvcHtmlString GoogleAjax(this HtmlHelper helper, String key, String[,] libraries) {

      
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend