Web Forms :: Unable To Retrieve Dynamic Panel Object Controls?

Jul 6, 2010

I have a form in a page and a panel inside the form.The panel gets loaded with dynamic controls like radio button and text boxes.

User is allowed to choose any radio option and enter any value in the textbox beside it and then goes for submit button to move to next stage.

Problem Descritopn:

I load the controls in the panel based on the index of a combo control on the same form.it is done in selectedIndexChanged - This is working fine.

When i go for the submit button and ask for the textbox control, it says "object reference not set to instance of object", denoting that instance is not available. Moreover the panel control list gets empty automatically.

View 6 Replies

Similar Messages:

Web Forms :: Retrieve Multiple Controls Added In Panel Created At Rutime

Mar 18, 2010

i have to access Textbox and check box values at same time those check box and text box created at run time .i know how i can retrive single controll but problem is that i want both control values at same time to add them in database


View 1 Replies

Forms Data Controls :: Checkbox In GridView - Unable To Retrieve Checked Value

Mar 9, 2011

i got checkbox in gridview which put inside the itemtemplate. the problem is when i tick on the checkbox, the value for checked property still is a false value. Wat;s wrong?

aspx :


GridViewRDR1_Hidden.Rows.Count > 0
row As
cb As
= CType(row.FindControl("chkstatus"),

View 1 Replies

Forms Data Controls :: Unable To Retrieve New Inputs And Syntax Error

Jul 27, 2010

I am trying to update the database with the edited data. However, it did not manage to read the edited data from the textbox. It returned the retrieve data that I have done in the Page_Load instead. Is there any part of the code that I have written wrongly? I did manage not to use <EditItemTemplate> in my past project and manage to update the database with the same logic.

<!-- This DataList is created to view Personal Information -->
<asp:DataList ID="personal_dl" runat="server"> <ItemTemplate>
<table> <tr> <td style="width: 100px; text-align: left;">
<asp:Label ID="first_lbl" runat="server" ForeColor="Black" Font-Size="11px" Text="First:"></asp:Label></td> <td style="width: 350px">
<asp:TextBox ID="first_tb" runat="server" Width="341px" Font-Size="11px" Text='<%# Eval("FIRST") %>'> </asp:TextBox> </td> </tr> <tr>
<td style="width: 100px; text-align: left">
<asp:Label ID="name_lbl" runat="server" Font-Size="11px" ForeColor="Black" Text="Name:"></asp:Label> </td> <td style="width: 350px">
<asp:TextBox ID="name_tb" runat="server" Width="341px" Font-Size="11px" Text='<%# Eval("NAME") %>'> </asp:TextBox> </td> </tr> <tr> <td style="width: 100px; text-align: left;">
<asp:Label ID="id_lbl" runat="server" ForeColor="Black" Font-Size="11px" Text="ID:">
</asp:Label> </td> <td style="width: 350px">
<asp:TextBox ID="id_tb" runat="server" Width="341px" Font-Size="11px" Text='<%# Eval("ID") %>'> </asp:TextBox> </td> </tr> <tr> <td style="width: 100px; text-align: left;">
<asp:Label ID="contact_lbl" runat="server" ForeColor="Black" Font-Size="11px" Text="Contact No.:"> </asp:Label> </td> <td style="width: 350px">
<asp:TextBox ID="contact_tb" runat="server" Width="341px" Font-Size="11px" Text='<%# Eval("TELEPHONE_HP") %>'> </asp:TextBox> </td> </tr> <tr> <td style="width: 100px; text-align: left;"> <asp:Label ID="add_lbl" runat="server" ForeColor="Black" Font-Size="11px" Text="Address:"> </asp:Label> </td> <td style="width: 350px">
<asp:TextBox ID="add_tb" runat="server" Width="341px" Font-Size="11px" Text='<%# Eval("ADDRESS") %>'> </asp:TextBox> </td> </tr> </table> </ItemTemplate> </asp:DataList>
<br /> <div style="text-align: center; color: Red; width: 460px;">
<asp:Label ID="errorMsg_lbl" runat="server" />
<asp:Button ID="edit_btn" runat="server" Text="Update" />
<asp:Button ID="createBtn" runat="server" Text="Insert" /></div>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'display information in datalist
Dim login As String = Session("login")
Dim id As String = Session("id")
bindDataList(personal_dl, getPersonalContent(login, id))
'display necessary DataList
personal_dl.Visible = True
'declare fields
Dim i As Integer
Dim first_tb, name_tb, id_tb, contact_tb, add_tb As New TextBox
For i = 0 To personal_dl.Items.Count - 1
first_tb = personal_dl.Items(i).FindControl("first_tb")
name_tb = personal_dl.Items(i).FindControl("name_tb")
id_tb = personal_dl.Items(i).FindControl("id_tb")
contact_tb = personal_dl.Items(i).FindControl("contact_tb")
add_tb = personal_dl.Items(i).FindControl("add_tb")
'set fields as ReadOnly - cannot edit
first_tb.ReadOnly = False name_tb.ReadOnly = False id_tb.ReadOnly = False
contact_tb.ReadOnly = False add_tb.ReadOnly = False Next
End Sub

Protected Sub edit_btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles edit_btn.Click 'declare fields
Dim i As Integer Dim first_tb, name_tb, id_tb, contact_tb, add_tb As New TextBox
Dim id As String = Session("id")
For i = 0 To personal_dl.Items.Count - 1
first_tb = personal_dl.Items(i).FindControl("first_tb")
name_tb = personal_dl.Items(i).FindControl("name_tb")
id_tb = personal_dl.Items(i).FindControl("id_tb")
contact_tb = personal_dl.Items(i).FindControl("contact_tb")
add_tb = personal_dl.Items(i).FindControl("add_tb")
Next Dim myConnection As OleDbConnection = dbConnection()
Dim cmd As New OleDbCommand
Dim sqlStatement As String
Dim condition As String
condition = "UPDATE staff " + _
"WHERE (ID= @id)" sqlStatement = condition cmd.CommandText = sqlStatement
cmd.CommandType = CommandType.Text cmd.Parameters.AddWithValue("@FIRST", first_tb)
cmd.Parameters.AddWithValue("@NAME", name_tb)
cmd.Parameters.AddWithValue("@ID", id_tb)
cmd.Parameters.AddWithValue("@TELEPHONE_NO", contact_tb)
cmd.Parameters.AddWithValue("@ADDRESS", add_tb)
cmd.Parameters.AddWithValue("@ID", id)
cmd.Connection = myConnection
Try myConnection.Open()
cmd.ExecuteNonQuery() Catch ex As Exception
Finally If myConnection.State = ConnectionState.Open Then
End If
End Try
'display information in datalist
Dim login As String = Session("login")
bindDataList(personal_dl, getPersonalContent(login, id))
End Sub

View 12 Replies

Forms Data Controls :: Unable To Retrieve Cell Content In A Gridview

Oct 4, 2010

myString is always empty in the code below.


Here's the .aspx file:


View 4 Replies

Web Forms :: Unable To Read Web.config File/Object Reference Not Set To An Instance Of An Object

Nov 2, 2010

I have a website written in C# that was running fine on one server. We moved it to another server and have a couple issues. I am mainly a VB.NET coder but can do a few things in C#. This is not a project - it is a website and can open it in VS2008 no problem. This is an admin site for the whole website where the user can add customer comments, etc. When logging in, it works fine. I can go to one of the admin pages after logging in and works. If I go to two other different pages, I get this error:

Object reference not set to an instance of an object.


It turns out this is in the main.master page and it is used by the other pages that load fine. The ApplicationTitle variable is set right in the web.config file and like I said, it shows on the other pages.

My question is why would this code work fine for some pages and not two others? All of these admin pages are under a folder called Admin and the web.config file is in the root folder of the website. Its almost like these two pages cannot see the web.config file in the root folder? Why would that be if thats the case?

View 3 Replies

Web Forms :: Dynamic Composite Controls Within Update Panel?

Aug 1, 2010

Dynamic Composite Controls Within Update Panel?

View 2 Replies

Forms Data Controls :: Unable To Add A Literal To A Panel Inside A Formview

Nov 14, 2010

I am facing a problem with panel inside a fromview...when i am trying to add some to the panel its not working....My code is as follows


I tried with the place holder and its worked fine but not with panel...

Is there any way to add CSSClass to a place holder...

View 5 Replies

Forms Data Controls :: Trying To Use Dynamic Object In A Databinding Tag

Sep 18, 2010

im trying to use dynamic object in a databinding tag , it gives me error that the property does not exists even though i can see all the properties there in the vs debug mode

here is what im trying to do:


my method signature:

public static dynamic MyMethod()


in control itemtemplate:

<%# MyMethod().SomeProperty %>

if also trite the other way:


public static object MyMethod()


<%# ((dymanic)MyMethod() ).SomeProperty%>

But i dont know why it cant resolve the properties , even though i can see them when the databinder control throws an exception (its working fine outside the databinder tag (ie normal aspx tags <% %>)

View 1 Replies

Forms Data Controls :: Unable To Get Dynamic Generated Dropdownlist Item

Sep 22, 2010

i'm using asp.net 3.5 and what im trying to do is create the dropdownlist item dynamically base on value in each datarow, then user select from dropdownlist and click button to postback, when postback system should be able to know what value has been selected by user. the problem with following code is during postback, event of "OnItem_Created" get fired and e.Item.DataItem return null, therefore the dropdownlist will not get populated with the items and that caused the dropdownlist unable to return value selected by user. am i missing anything? is "OnItemCreated" the best place to dynamic create the dropdownlist item?


View 2 Replies

Forms Data Controls :: Unable To Create Dynamic Menu From Database?

Sep 27, 2010

I am unable to create dynamic menu from database. I have made two tables for this work.First table is Menu which stores menu id and its relevant name.

MId Text
1 File
2 Edit
3 View

Second table is subMenu which stores submenus which will be linked to the menu table with menu id.

SId Text MID
1 New 1
2 Open 1
3 Save 1
4 Cut 2
5 Copy 2

the menu should be created dynamically from the database, each menu should be displayed in single row

when we click on a menu the submenus are displayed in rows that in expand & contrast form

how to design & develope this page

View 3 Replies

Forms Data Controls :: Unable To Change Visible Status - Panel Inside DataList

Jun 23, 2010

In the main code, I just have a panel inside a DataList control. I'm attempting to adjust change the visibility to true or false in the code behind, but it's not having any affect on the panel.


View 9 Replies

Forms Data Controls :: Unable To Cast Object Of Type System

Mar 3, 2010

I need some help on the row updating for a gridview that i bind manually to a list, not using objectdatasource or sqldatasourcehere is my rowupdating. What i want to do for now is just get the values from the textboxes and I will store them to sting variables then I will call my update function and pass those as parameters. How do I get the data from the textboxes that the user just edited. I have the following but I am getting an error: "unable to cast object of type System.UI.LiteralControl to type System.UI.TextBox

View 5 Replies

DataSource Controls :: Unable To Retrieve Data From Two Tables While Using Inner Join?

May 25, 2010

I need to retirve data from two tables...when i click a value in dropdown list, i need to retrieve values from two tables based on that id( which i have selected in dropdown)..so when i have written query ( "Select assign_issue.issue_assigned_to, assign_issue.created_on,assign_issue.last_Date,
issue_register.issue_desc,issue_register.issue_Priority from assign_issue INNER JOIN Issue_register ON assign_Issue.Issue_ID = issue_register.Issue_ID where issue_register = '" + ddlissueid.selecteditem.text + "'")..query is executing ..when it comes to dr = cmd.executereader()..Dr is unable to read..it is showing false when i trace..unable to read into while loop.

View 1 Replies

Forms Data Controls :: Deleting From GridView Without Call Command - Unable To Cast Object

Jan 28, 2010

I'm using vb and after i converted it from C# and tried to implement this:


I got an error that said: Unable to cast object of type 'System.Web.UI.WebControls.GridView' to type 'System.Web.UI.WebControls.LinkButton'.

And here's my code for the gridview table.


I've tried altering the code here and there but it never work

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)

View 5 Replies

Forms Data Controls :: Unable To Retrieve A Gridview Selected Row Cells Data

Mar 16, 2010

i am still stumped with this operation: i am trying to retrieve a GridView selected row data..here is my code.. the commented part that gives me the selectedindex works just fine....but the one giving the selected row cell value does't work and there is no error.. The update operation is done successfully...weired. i need to assigned selected row cells values to variables ..do some calculations and then re-assign the result calculation to cell[9]..

protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
string s = GridView1.SelectedRow.Cells[5].Text;
TextBox1.Text = s.ToString();
//string s2 = GridView1.SelectedIndex.ToString();
//TextBox1.Text = s2.ToString();

View 5 Replies

DataSource Controls :: Retrieve A Certain Mssql Field And Use It As Value Source In An Object?

Mar 19, 2010

I'm an experienced PHP programmer that is new to ASP.net (C#). I'm trying to figure out how to do a manual echo of a specific field from an SQL database and was wondering how you do an if condition in case the field would meet certain criteria ?

What I want the script to do is check in the database if a certain condition is activated, then the html page should echo a windows media player object with the source of the video coming from the database itself ( $line[Video], and if the condition isn't active then either don't echo the player or just echo an old video (in the script I'm just printing a message).

in PHP:


View 9 Replies

Web Forms :: "object Reference Not Set To An Instance Of An Object" Error When Access The Dynamic Control

Nov 25, 2010

I got this error "object reference not set to an instance of an object" when i want to display the values of dynamic generated drop down lists by pressing a button to show the values in Listitem.

i have master page in which i use :



3) treeview menu

Server side Code is:


View 3 Replies

WCF / ASMX :: Server Was Unable To Process Request / Object Reference Not Set To An Instance Of An Object?

Apr 16, 2010

I have a webservice, it has few webmethods. when i create a client proxy and invoke the methods to check its response, i am getting this error. Can someone tell me what things can i check to know the cause of this? The error is not saying much hence blocked on this.

View 1 Replies

Forms Data Controls :: Passing Dynamic Value To Detail View Of Grid Through Object Selecting Parameter

Oct 4, 2010

Passing dynamic value to Detail view of grid through object selecting parameter

View 4 Replies

Web Forms :: Retrieve Dynamic HtmlTable Data?

Feb 22, 2010

a pure html table will be generated on the client side. (using jQuery to add dynamic new rows to the table when the user clicks a button).

These rows contain textboxes, dropdownlists, checkboxes and other input controls.

When the user clicks a button, a PostBack is triggered in which I need to access this data from the table on the server side, validate it (yes all rows at once) and perform other actions on it.

I'm able to perform the client side and access the table data on server side by adding runat="server" to the table tag. However, I only see the initial table rows (not the ones added through JavaScript) and I have troubles retrieving the different inputs from the rows.

View 1 Replies

DataSource Controls :: Unable To Put Space To Dynamic Sql Query?

Jan 20, 2010

i have a query like this and its running correctly

FROM P INNER JOIN PCommunication ON P.ID = PCommunication.ID
WHERE P.Telephone IS NOT NULL AND CAST(REPLACE(LTRIM(RTRIM(SUBSTRING(P.Telephone, 2, LEN(P.Telephone)))), ' ', '') AS BIGINT) > 5000000000
AND PCommunication.TypesID = '7667d187-5fe1-4aaf-9e31-79761561da58'

i am trying to use it with dynamic query like this but its not working

@query = 'SELECT CAST(REPLACE(LTRIM(RTRIM(SUBSTRING(P.Telephone, 2, LEN(P.Telephone)))), ''' ''', '''''') AS BIGINT)

View 9 Replies

AJAX :: How To Do Update Panel And Dynamic Controls And Post Back

Sep 29, 2010

I have a page that is mostly dynamically built in the page load of my VB.net code behind page.

The issue is that I made a change to the page and added a button that redirects to a secondary page. When the button is clicked there is a very noticeable lag until the button click event fires because the page is being rebuilt every time.

I had not wrapped the code in the load event in the If not ispostback.... because I have dynamic controls that the user interacts with and I need the page to be rebuilt when the user clicks them.

The dynamic controls are clickable table cells. I did some looking and I found that the RegisterPostBackControl. I thought this would be perfect but, it does not although I maybe using it incorrectly.

Here is the code flow.


View 4 Replies

Rendering Dynamic Controls Via JavaScript In A Wizard In An Update Panel?

Mar 3, 2011

I have a user control.

On that user control is an update panel.

In that update panel is a wizard.

One of the steps is as follows.


What this does is create a javascript spinner control. Now when I click the NEXT button onto this step it generates the spinner control. I click next to go to the next step, then I click PREVIOUS to go back to this step and the spinner control is not generated.

Now I have tested this on an ASPX page and it seems to work, I then copy the code across to an ASCX control and put the page live and it does not work.

The update panel has an animation extender that just displays a div with a processing gif when you click next/previous.

So any reason why it creates the control on the next and not the previous step?

View 1 Replies

Web Forms :: How To Retrieve Dynamic Image With Links From Database

May 25, 2013

How to dynamically generate the below image tag with links from the database.Number of images should be the number of items in the database.

Can we use listview or repeater to achive this.If yes how ??

<div class="social-icons_box">
<div class="label_social">
Get Social


View 1 Replies

Copyrights 2005-15 www.BigResource.com, All rights reserved