Challanging Tree View Problem


,

I have a tree view. When I load it, it has 200 + nodes added to it, and is displayed with 2 levels expanded. Since this tree view is a userinterface for security settings, I have checkboxes viewable on the treeview.

What i'd like to do is when a button is clicked, code cycles through the nodes, checks if the checkbox is checked, and saves an ID attribute of hte node. Here's my problem: The TreeView responds that it only has ONE (1) node! But I can traverse the tree to all of them that I added.

Any thoughts on why its doing this, and on how I could accomplish my task
Posted On: Wednesday 2nd of January 2013 02:28:52 AM Total Views:  276
View Complete with Replies

RELATED TOPICS OF ASP.NET PROGRAMMING LANGUAGE




Adding CSS Progmatically

I'm writing a site in ASP.NET 2.0 and I'm using a masterpage to give my site a consistent look. The thing is I'd like some of my content pages to have their own CSS files in addition to the global style I apply with my masterpage. I found a few tutorials that suggested using HtmlHead, but they didn't go much farther than that. This is what I have so far: protected void Page_Load(object sender, EventArgs e) { HtmlHead head = (HtmlHead)Page.Header; HtmlLink link = new HtmlLink(); link.Attributes.Add("href", Page.ResolveClientUrl("/styles/signup.css")); link.Attributes.Add("type", "text/css"); link.Attributes.Add("rel", "stylesheet"); head.Controls.Add(link); } The style doesn't appear with this, but my CSS is fine. At least it works when I link all the css files directly from the masterpage.
VIEWS ON THIS POST

128

Posted on:

Friday 16th November 2012
View Replies!

connection to database

i am biginer of .net so plz send me stap by stap procdure how i start asp page or project
VIEWS ON THIS POST

120

Posted on:

Friday 16th November 2012
View Replies!

asp page giving error

Anshusys on submitting this page getting error in mozilla browser Microsoft VBScript runtime error '800a0009' Subscript out of range: '[number: 1]' /formmail.asp, line 128 error is not coming in internet explorer.
VIEWS ON THIS POST

153

Posted on:

Friday 16th November 2012
View Replies!

SQL doesn't know how to count

ccnconnection.Open() strSQL = "SELECT Count(IDS) FROM tblVrienden WHERE ((ID2 =" & Session("ID").ToString & ") and (ID1 =" & id & "))" Dim intaantal As Integer scmdGebruiker.CommandText = strSQL intaantal = CInt(scmdGebruiker.ExecuteScalar.ToString) If intaantal = 1 Then btnadd.Visible = False End If strSQL = "SELECT Count(IDS) FROM tblVrienden WHERE ((ID1 =" & Session("ID").ToString & ") and (ID2 =" & id & "))" intaantal = CInt(scmdGebruiker.ExecuteScalar.ToString) If intaantal = 1 Then btnadd.Visible = False End If In database there are the following values: IDS=8 ID1=1 ID2=3 strsql = SELECT Count(IDS) FROM tblVrienden WHERE ((ID2 =1) and (ID1 =3)) intaantal = 0 What is wrong
VIEWS ON THIS POST

142

Posted on:

Friday 16th November 2012
View Replies!

video conferencing

Dear all I doing website using asp.net and this my frist time using this techniq and ,I want to implemting video conferencign p2p for the user and also ,I wnad add popup chat window so please could you help me in this regards or guid me to done that it is very important for me and very urget thanks in advace and please don histate to help me for more information for who can help this is my e-mail Edited by macosxnerd101: Email removed in compliance with site policies. Please keep all work via the forums.
VIEWS ON THIS POST

151

Posted on:

Friday 16th November 2012
View Replies!

Floating window in asp.net

how to get floating window in asp.net....is der any control for it...i found AlwayVisible Ajax control,bt its a static 1..
VIEWS ON THIS POST

136

Posted on:

Friday 16th November 2012
View Replies!

Runtime error on aspx

Does anyone know how come i got the following error message. My website doesn't have any problem when it runs on debug mode but after i published it to my server(my pc - Inetpub\wwwroot folder) and i got the following error message. "Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine." Can someone help me about this problem
VIEWS ON THIS POST

141

Posted on:

Saturday 24th November 2012
View Replies!

Web Shared Library

I am currently working on my locations intranet applications. As such, i am finding myself developing, and/or copying, the same code over and over again. What i would like to do is create a singular location that contains a library of functions, methods, classes, interfaces, etc. that i use on a regular basis. I looked at using WCF but it seems to be more XML based instead of a shared library interface. Any ideas on how to accomplish this in IIS6 Thought of making a web service but it still operates as WCF.
VIEWS ON THIS POST

98

Posted on:

Saturday 24th November 2012
View Replies!

Displaying One type and not the other

I have a display page that displays the records from a table in a table based on state. There is a distinguishing field for two different types of records. I want to determine which it is and only display one of the two types Can this be done with a drop down/select option or should i just make 2 output pages and change the code to correspond Is the output code. I want it to display records with the type of Lawyer OR ExpertWitness. My if then statements apparently are rusty. The determining field in the DB is called 'reftype' and that is the field that should limit the output based on it's selection. using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; public partial class ReferralDirectory : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { buildtable(); } } private void buildtable() { TableRow row = null; TableCell cell = null; string stateabbrev = string.Empty; foreach (DataRow dr in functions.GetStates().Tables[0].Rows) { row = new TableRow(); cell = new TableCell(); cell.BackColor = System.Drawing.Color.Gray; cell.ForeColor = System.Drawing.Color.White; cell.CssClass = "Boldtext"; stateabbrev = dr["abbrev"].ToString(); cell.Text = dr["state"].ToString(); row.Cells.Add(cell); tblReferrals.Rows.Add(row); addlisting(stateabbrev); } } private void addlisting(string abbrev) { TableRow row = null; TableCell cell = null; string state = string.Empty; row = new TableRow(); cell = new TableCell(); cell.Height = Unit.Pixel(20); cell.Text = " Back to Top"; row.Cells.Add(cell); tblReferrals.Rows.Add(row); foreach (DataRow dr in directorylistings.GetDirectoryListings().Tables[0].Rows) { state = dr["refstate"].ToString(); if (abbrev == state) { row = new TableRow(); cell = new TableCell(); cell.Text = "" + dr["reffirstname"].ToString() + " " + dr["reflastname"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); row = new TableRow(); cell = new TableCell(); cell.Text = "" + dr["reffirmname"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); row = new TableRow(); cell = new TableCell(); cell.Text = "" + dr["refspecialty"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); row = new TableRow(); cell = new TableCell(); cell.Text = "" + dr["refaddress"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); row = new TableRow(); cell = new TableCell(); cell.Text = "" + dr["refcity"].ToString() + ", " + dr["refstate"].ToString() + " " + dr["refzipcode"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); if (!string.IsNullOrEmpty(dr["refphoneareacode"].ToString()) && !string.IsNullOrEmpty(dr["refphonenumber"].ToString())) { row = new TableRow(); cell = new TableCell(); cell.Text = "(" + dr["refphoneareacode"].ToString() + ") " + dr["refphonenumber"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); } if (!string.IsNullOrEmpty(dr["reffaxareacode"].ToString()) && !string.IsNullOrEmpty(dr["reffaxnumber"].ToString())) { row = new TableRow(); cell = new TableCell(); cell.Text = "(" + dr["reffaxareacode"].ToString() + ") " + dr["reffaxnumber"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); } if (!string.IsNullOrEmpty(dr["refemailaddress"].ToString())) { row = new TableRow(); cell = new TableCell(); cell.Text = "" + dr["refemailaddress"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); } if (!string.IsNullOrEmpty(dr["refwebsiteaddress"].ToString())) { row = new TableRow(); cell = new TableCell(); cell.Text = "" + dr["refwebsiteaddress"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); } if (!string.IsNullOrEmpty(dr["refdescription"].ToString())) { row = new TableRow(); cell = new TableCell(); cell.Text = "" + dr["refdescription"].ToString() + ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); } row = new TableRow(); cell = new TableCell(); cell.Height = Unit.Pixel(20); cell.Text = ""; row.Cells.Add(cell); tblReferrals.Rows.Add(row); } } } } We could use more activity on here anyways. I promise I will be a useful resource in the near future when i knock the rust off these prog fingers
VIEWS ON THIS POST

130

Posted on:

Saturday 24th November 2012
View Replies!

mysql, asp.net (C#) and hebrew. need help.

I have a webpage in asp.net which connect to mysql 4.1 db. This page can view/add/edit data from a table in my db. When I run this page locally and view/add/edit data in hebrew, it displays just fine. But when I upload my project to my web server (web server and mysql db are from the same hosting company, which is a non Israeli company) and try to view/add/edit data in hebrew, it all comes out as question marks (\t\t) When I check with the specific table in phpMyAdmin, I can see that the data I added using the page locally (the way it works) is shown in gibberish (πριεο - but I think its 'good' gibberish, because it is readable in my local page). If I try to add data using the same page on the server, it shows in phpMyAdmin as question marks (\t). The collation is set to UTF8_unicode_ci. I've tried to use encoding coversion in my code, i've tried changing the deefault encoding. nothing works. I suspect the problem lies in the hosting company's web server bcz the same code works fine locally on my computer, but doesn't on their server. I just don't know what is wrong with their server. Could it be something that needs to be defined in Mysql If anyone knows how to make this work, please let me know. I've been battling this issue for 2 weeks now and still havn't advanced.
VIEWS ON THIS POST

304

Posted on:

Saturday 24th November 2012
View Replies!

Advantage of a repeater?

Well, I was using a SqldataReader to get stuff from the database, then I was outputing the results into html into a .InnerHtml to output the results. Someone suggested using a Repeeater to display the information instead. Any reason why it would be better This post has been edited by Mowgef: 29 May 2009 - 01:45 PM
VIEWS ON THIS POST

270

Posted on:

Saturday 24th November 2012
View Replies!

asp.net with oracle connectivity

using_Syste1.doc (21.5K) Number of downloads: 50 using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.OracleClient; public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string strconnectionstring = "Data Source = \t;User ID =\t;Password=\t;Unicode=True"; string strSQL = "select * from emp1 where eid"+ = + "TextBox1"; OracleConnection conn = new OracleConnection(strconnectionstring); OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; conn.Open(); cmd.CommandText = strSQL; cmd.CommandType = CommandType.Text; OracleDataReader dr = cmd.ExecuteReader(); Response.Redirect("Default.aspx"); dr.Dispose(); cmd.Dispose(); conn.Dispose(); } }
VIEWS ON THIS POST

109

Posted on:

Saturday 24th November 2012
View Replies!

Suggestions

Hi ,I had been making a search for my web page. This has been successful but I don't get an automatic display of the items I search for. As of now I can type for example a letter and then click a button, then all the names beggining with the letter is diplayed on a listbox.Is there any way i can have the items displayed automatically as I type Like when I type "s" all names with "s" should be displayed and when I type "st" all names beginning with "st" should be displayed immediately
VIEWS ON THIS POST

114

Posted on:

Sunday 25th November 2012
View Replies!

datagrid not showing updates

I have a button on a web page which outputs the records in the datagrid to a pdf and updates a check box on each row to show it has been printed. After the pdf is output, the sql table is updated and I rebind the datagrid. At that point you cannot see the web page or updated check boxes as the pdf is open over the top of the web page. If I now print the pdf or use the back button to return to my web page the checkboxes are still all blank except the last one in the grid. The table is being updated so how can I return from my pdf and see the updated checkboxes TIA
VIEWS ON THIS POST

124

Posted on:

Sunday 25th November 2012
View Replies!

how to paste our own created user contorl on a web form

hii have created ascx. user control but dont know from where can i bring it on my web form.:)
VIEWS ON THIS POST

217

Posted on:

Sunday 25th November 2012
View Replies!

Display Dynamic Column Names

How do I create a DataGrid if the column names are generated dynamically in the SQL query For eg if the column names are generated like this:strSQL1="SELECT DISTINCT(ErnCode) AS ErnCode FROM ALLV"objDapter1=New SQLDataAdapter(strSQL1,objConn)objDapter1.Fill(dTable)Dim strSQL2 As New StringBuilder("SELECT DISTINCT(em.ECode),em.EName,")For Each dRow In dTable.Rows\t\tstrErnCode=dRow.Item(0).ToString\t\tstrSQL2.Append("(SELECT SUM(allv.Amt) FROM ALLV AS allv WHERE allv.ErnCode='")\t\tstrSQL2.Append(strErnCode)\t\tstrSQL2.Append("' AND em.ECode=allv.ECode AND MONTH(allv.Date)=4) AS ")\t\tstrSQL2.Append(strErnCode)\t\tstrSQL2.Append(",")NextstrSQL2.Append(" FROM EMST AS em,ALLV AS allv WHERE em.ECode=allv.ECode ORDER BY em.ECode")strSQL2.Replace(", FROM"," FROM").........................myDG.DataBind()As you can see, the alias column names in the 2nd SQL query are being generated dynamically depending upon what records are beingretrieved by the 1st SQL query. The records of the 1st 2 columns (ECode & EName) retrieved by the 2nd query can be displayed inthe DataGrid as follows:But how do I display the records retrieved by the other columns (i.e. other than the ECode & the EName columns) in the DataGrid that are being fetched by the 2nd SQL query as the rest of the column names are being generated at runtime & hence I am not aware of the rest of the column names at design time Had I known the column names at design time, then the records could have been displayed in the same way as how the records of the ECode & the EName columns are displayed in the DataGrid code sample shown above
VIEWS ON THIS POST

129

Posted on:

Monday 26th November 2012
View Replies!

clear buffer

how to clear the buffer data
VIEWS ON THIS POST

151

Posted on:

Monday 26th November 2012
View Replies!

Data adapter turorial request

I want a datareader tutorial to access data from DB record by record (row wise) and display it in both as next data and previous one. Please provide me the tutorial with this topic. Thankxx in advanced.
VIEWS ON THIS POST

102

Posted on:

Tuesday 27th November 2012
View Replies!

Need help with contact page, been teasing me for hours.

I have been following a tutorial, and have made a contact page. But when I try to debug I get the following 3 error messages. Does anybody know what the errors mean 1 ASP.contact_aspx.GetTypeHashCode()': no suitable method found to override c:\Users\RenePedersen\AppData\Local\Temp\Temporary ASP.NETFiles\renedesign\cfc73a41412f916b File: \App_Web_epukpzey.4.cs Line: 1734 2 ASP.contact_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\Users\Rene Pedersen\AppData\Local\Temp\Temporary ASP.NETFiles\renedesign\cfc73a41 \412f916b File: \App_Web_epukpzey.4.cs Line: 1739 3 ASP.contact_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\Users\Rene Pedersen\AppData\Local\Temp\Temporary ASP.NET Files\renedesign\cfc73a41 \412f916b File: \App_Web_epukpzey.4.cs Line: 225 Here are the lines of code that the errors refer to: [System.Diagnostics.DebuggerNonUserCodeAttribute()] public override int GetTypeHashCode() { return -1526348532; } [System.Diagnostics.DebuggerNonUserCodeAttribute()] public override void ProcessRequest(System.Web.HttpContext context) { base.ProcessRequest(context); } [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()] public class contact_aspx : global::Contact, System.Web.IHttpHandler { private static bool @__initialized; private static object @__fileDependencies; } , I was referring to the actual code, not the markup of the page, sorry for the confusion
VIEWS ON THIS POST

211

Posted on:

Tuesday 27th November 2012
View Replies!

Print web page and pdf documents that are linked to the page

I have a request to create a batch print program that will print the contents of a web page as well any PDF documents that are linked to the page.For example a user fills out a contact information web form and uploads a resume to the site.\tI would like to create a method that will print the user's contact information and his pdf resume all in one step.\tThe interface will be an ASP.net web page and the PDFs will be stored in a SQL Server table.Has anyone tried this beforeEric
VIEWS ON THIS POST

301

Posted on:

Tuesday 27th November 2012
View Replies!

web.sitemap problem

all.In my site map some urls have a parameter.\tIf the parameter has no spaces in it it all works fine.\tIf i put a space in (i have to don't ask!!) it all goes wrong.\tTHe url in the browser becomes v%20w where in the site map it is v wI can not put v%20w into the site map as it thorws a malformed xml errorSny ideas }...the bane of my life!http://www.fuzzyd.co.uk
VIEWS ON THIS POST

133

Posted on:

Tuesday 27th November 2012
View Replies!

RequestedFieldValidation problem

together!I have the problem that I have a aspx page and I want to validate it, but only if one button is pressed. if another button is pressed it shouldn't be pressed. So started enabling and disabling the validations.This works pretty fine until I one time get an validation exception, because then the code to disable it is not executed anymore.I already searched a lot but I couldn't find a solution
VIEWS ON THIS POST

123

Posted on:

Tuesday 27th November 2012
View Replies!

submit form to another page

I'm new to Asp.net, and have a button being clicked that should be submitting a form on the .aspx page.\tThe button code (in page DepositAccount.aspx) is the following: this is in a form with the following tag:When clicked on, the form posts to itself;\tHowever, I need to go to Confirmation.aspx, and get some variables there using the post method.\tWhat am I missing here\tIs there a way to run code in a function on the 1st page (calling our business logic component, etc, and then still post to the other page\tOr do I just need to change syntax
VIEWS ON THIS POST

115

Posted on:

Tuesday 27th November 2012
View Replies!

ExecuteReader Error

What does this message mean\t Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.here is my codePublic Sub Page_Load(Source as Object, E As EventArgs)if Not IsPostBack Then\t\tBindDataEnd If End SubSub BindData\t\tDim dbconn As SqlConnection = New SqlConnection("server=AM1ST_FS1;database=HRINFO;uid=sa;")\t\tDim selectCMD As SqlCommand = New SqlCommand(" Select * From phonelist where location = 1st Floor Order by lastName")\t\tdbconn.open()\t\tfstfloor.DataSource = selectCMD.ExecuteReader()\t\tfstfloor.DataBind()\t\tdbconn.close()End Sub
VIEWS ON THIS POST

114

Posted on:

Wednesday 28th November 2012
View Replies!

Frames on aspx web page

hi,is it possible to add frames to the aspx page I need a part to be shown every time and every link click to be shown in other frame.Tnx
VIEWS ON THIS POST

126

Posted on:

Tuesday 1st January 2013
View Replies!

Specified cast is not valid

I am doing an update to a Database, and the Stored procedure works, however, I'm getting a cast exception..CODEException Details: System.InvalidCastException: Specified cast is not valid.Source Error: Line 127:\t\t\t\tDim Last As String = CType(e.Item.Cells(4).Controls(0), TextBox).TextLine 128:Line 129:\t\t\t\tDim Dleave As String = CType(e.Item.Cells(5).Controls(0), TextBox).TextLine 130:\t\t\t\tDim DReturn As String = CType(e.Item.Cells(6).Controls(0), TextBox).TextLine 131:\t\t\t\tDim TimeIn As String = CType(e.Item.Cells(7).Controls(0), TextBox).TextSource File: c:\inetpub\wwwroot\GenX\Broadcast.aspx.vb\t\tLine: 129 Stack Trace: [InvalidCastException: Specified cast is not valid.]\tGenX.Broadcast.Dg_Update(Object sender, DataGridCommandEventArgs e) in c:\inetpub\wwwroot\GenX\Broadcast.aspx.vb:129\tSystem.Web.UI.WebControls.DataGrid.OnUpdateCommand(DataGridCommandEventArgs e) +109\tSystem.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +507\tSystem.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26\tSystem.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +106\tSystem.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26\tSystem.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121\tSystem.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +115\tSystem.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18\tSystem.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138\tSystem.Web.UI.Page.ProcessRequestMain() +1277how it works, (or suppose to) I have a datagrid in Edit mode and the columns turn to textboxes, I retrieve the values in the boxes, and then update the DB... I have the dates/times as varchar, then convert thru my Stored Procedure. this works, but the vb code isn't.
VIEWS ON THIS POST

129

Posted on:

Tuesday 1st January 2013
View Replies!

Difficulties getting started

Hi all,I am very new at ASP .NET and have attempted to start learning how to develop with this technology by going through the tutorial at w3schools.com. Unfortunately, I have gotten stuck pretty early on. I am attempting to complete the section at http://www.w3schools.com/aspnet/aspnet_pages.asp which gives examples of basic HTML, ASP and ASP.NET pages. I have copied both the ASP and ASP.NET examples to text files, and named them with the appropriate .asp and .aspx extensions respectively. However, when I open these files in Internet Explorer the executable code between the does not appear. I am running WinXP Pro, and have installed the IIS, the .NET framework redistributable package v1.1 and the .NET framework SDK v1.1.Can anyone give me any idea why the code may not be executing in either of the ASP or ASP.NET files - is there perhaps something I have missed during setupMany
VIEWS ON THIS POST

130

Posted on:

Tuesday 1st January 2013
View Replies!

Progress Indicator

I have to be able to find this somewhere.\tDoes anyone know how I can pop up a progress indicator to show my user(s) that something is happening while they wait\tI have seen it done, but I cannot find any good resources to help me figure out how to do it.\tI have a great anim image that says loading, and I could use that. Or, a progress bar inside of .NET, fine with me.\tJust something.\tI am using VS.NET, vb and ASP.NET on IIS and Win2k.
VIEWS ON THIS POST

99

Posted on:

Tuesday 1st January 2013
View Replies!

how to change the values of label in listview from codebehind?

Actually i'm developing template using asp.net and c#.i'm using listview at my ascx page and my ItemTemplate is as below:CODE\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tand i retrieve the data from the database in ascx code behind as bellow:CODEpublic DataTable GetEmployee(string query){\t\tSqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);\t\tSqlDataAdapter ada = new SqlDataAdapter(query, con);\t\tDataTable dtEmp = new DataTable();\t\tada.Fill(dtEmp);\t\treturn dtEmp;}and also i bind the data in ascx code behind as follow:CODEprivate void BindLVP(string SortExpression){\t\tstring UpdateQuery = "Select * from Employee" + SortExpression;\t\tSqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);\t\thid_UpdateQTP.Value = UpdateQuery;\t\tlvProduct.Items.Clear();\t\tlvProduct.DataSource = GetEmployee(UpdateQuery);\t\tlvProduct.DataBind();}my question is how i can delete the and all the other label text like this in ItemTemplate and change the label.text in ItemTemplate from the code behind, i mean pass the data of the database to these label from code behind.appreciate your consideration.
VIEWS ON THIS POST

123

Posted on:

Tuesday 1st January 2013
View Replies!

Newbie Access data connection

Is it possible that you are missing a user name an password parameter.\tHere is a good web site that tells you how to properly construct your connection strings.www.connectionstrings.com
VIEWS ON THIS POST

127

Posted on:

Tuesday 1st January 2013
View Replies!

Dynamic Linkbuttons, custom paging & VB Class File

OK, Im finished pulling my hair out and now I need help. I have created a VB class file for my custom paging, in it I create a table with 2 rows, in the rows I have linkbuttons for first page, previous page, next page and last page. The buttoms are created like:CODE'configure the link buttons\tlink_1.ID = "f_link"\tlink_2.ID = "p_link"\tlink_3.ID = "n_link"\tlink_4.ID = "l_link"\tlink_1.Text = ""\tlink_4.Text = "Last >>"\tlink_1.CommandArgument = "FirstPage"\tlink_2.CommandArgument = "PreviousPage"\tlink_3.CommandArgument = "NextPage"\tlink_4.CommandArgument = "LastPage"\t\t\t\t\t\tAddHandler link_1.Command, AddressOf link_clickAddHandler link_2.Command, AddressOf link_clickAddHandler link_3.Command, AddressOf link_clickAddHandler link_4.Command, AddressOf link_clicklink_1.CausesValidation = Falselink_2.CausesValidation = Falselink_3.CausesValidation = Falselink_4.CausesValidation = Falsein the class file I have serveral properties :CODEPublic Property DG_Name() As StringGet\tReturn DGnameEnd Get\tSet(ByVal value As String)\t\tDGname = value\tEnd SetEnd PropertyPublic Property page_num() As Integer\tGet\t\tReturn my_page\tEnd Get\tSet(ByVal value As Integer)\t\tmy_page = value\tEnd SetEnd PropertyPublic Property tot_records() As Integer\tGet\t\tReturn total_records\tEnd Get\tSet(ByVal value As Integer)\t\ttotal_records = value\tEnd SetEnd PropertyPublic Property MyDG() As DataGridGet\tReturn DGEnd GetSet(ByVal value As DataGrid)\tDG = valueEnd SetEnd Propertyand the variables are declared here:CODEPublic DG As DataGrid = New DataGrid\t\t\t\tPublic my_page As IntegerPublic total_records As IntegerPublic DGname As StringThe link_click event is as such:CODEPublic Sub link_click(ByVal sender As Object, ByVal e As CommandEventArgs)\t\t\t\t\t\tDim lb As LinkButton = CType(sender, LinkButton)\t\t\t\t\t\tSelect Case lb.CommandArgument.ToString.ToLower\t\t\t\t\t\t\t\tCase "firstpage"\t\t\t\t\t\t\t\t\t\tDG.CurrentPageIndex = 0\t\t\t\t\t\t\t\t\t\tHttpContext.Current.Response.Write("you clicked " & lb.CommandArgument.ToString)\t\t\t\t\t\t\t\tCase "previouspage"\t\t\t\t\t\t\t\t\t\tIf DG.CurrentPageIndex = 0 Then\t\t\t\t\t\t\t\t\t\t\t\tDG.CurrentPageIndex = 0\t\t\t\t\t\t\t\t\t\tElse\t\t\t\t\t\t\t\t\t\t\t\tDG.CurrentPageIndex = page_num - 1\t\t\t\t\t\t\t\t\t\tEnd If\t\t\t\t\t\t\t\t\t\tHttpContext.Current.Response.Write("you clicked " & lb.CommandArgument.ToString)\t\t\t\t\t\t\t\tCase "nextpage"\t\t\t\t\t\t\t\t\t\tHttpContext.Current.Response.Write(tot_records & " :: " & my_page & " :: ")\t\t\t\t\t\t\t\t\t\tIf (total_records - 1) < page_num Then\t\t\t\t\t\t\t\t\t\t\t\tDG.CurrentPageIndex = 0\t\t\t\t\t\t\t\t\t\tElse\t\t\t\t\t\t\t\t\t\t\t\tDG.CurrentPageIndex = page_num + 1\t\t\t\t\t\t\t\t\t\tEnd If\t\t\t\t\t\t\t\t\t\tHttpContext.Current.Response.Write("you clicked " & lb.CommandArgument.ToString)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCase "lastpage"\t\t\t\t\t\t\t\t\t\tHttpContext.Current.Response.Write("you clicked " & lb.CommandArgument.ToString)\t\t\t\t\t\t\t\t\t\tDG.CurrentPageIndex = CType((DG.PageCount), Integer)\t\t\t\t\t\tEnd Select\t\t\t\tEnd SubThe response.writes work and tell me what I clicked, in the .aspx.vb file I set the properties in the class file as such:CODEpage.my_page = bud_pricing.CurrentPageIndexname.DG_Name = "bud_pricing"records.total_records = Rec_CountDG.DG = bud_pricingThe values set in the aspx.vb file arent getting to the class file so the paging dont work. The links show up beautifully but they dont page. Can someone PLEASE help me
VIEWS ON THIS POST

155

Posted on:

Wednesday 2nd January 2013
View Replies!

Help with looping through controls

I have this SubCODEPrivate Sub SetTextBoxes(ByVal Page As Control)\t\tFor Each c As Control In Page.Controls\t\t\tIf TypeOf c Is TextBox Then\t\t\t\t\tCType(c, TextBox).Text = ""\t\t\t\t\tCType(c, TextBox).Attributes.Add("onblur", "this.value=this.value.toUpperCase();")\t\t\t\tEnd If\t\tNextEnd SubBut it doesnt work. Can anyone tell me why (In the Page_Load I call it: SetTextBoxes(Page))
VIEWS ON THIS POST

110

Posted on:

Wednesday 2nd January 2013
View Replies!

panel control

the control renders as in IE and a in Firefox.\tThis is conflicting with the css. because the ASP is setting the table width=100%. I would like for it to render as a all the time.\tHow can i force it to render as a .\tI am using the panel control instead of the because i am having to change the visibility of the panel during the life of the page
VIEWS ON THIS POST

128

Posted on:

Wednesday 2nd January 2013
View Replies!

Can I place two submit buttons on one page ?

Hi ; I am somehow new to ASP.NET, I have a question can I place two submit buttons to submit email information on one page Which will send emails to recipient.
VIEWS ON THIS POST

373

Posted on:

Wednesday 2nd January 2013
View Replies!

Speed up application

What's the best, most common way to speed up an ASP.NET application\tVB.NET, IIS 6, SQL Server 2000, 4 tables (table with most records has about 35000)
VIEWS ON THIS POST

48

Posted on:

Wednesday 2nd January 2013
View Replies!

Mouse over with DropDownList

Has anyone seen an open drop down activate on mouse over\tIt would be a nice feature if the user could open up a drop box, say with 50 items, and the mouse down the list while it is open and see a java activated message.\tJust a thought.
VIEWS ON THIS POST

70

Posted on:

Wednesday 2nd January 2013
View Replies!

Simple... passing variable in a hidden form field

I don't know how to do this in ASP.NET.\tI've got a page which grabs the stored username of the logged in user.\tThen it displays that username in a label.\tI also need to be able to pass that username as a hidden form field back to the same page when the form is submitted.In the code below, the username is 'major_key' and I want to be able to set the value of a hidden form field to this so I can then append it to the url when the page is submitted...see the action attribute of the form.\tBasically, I need the code for the hidden field and the action attribute.
VIEWS ON THIS POST

66

Posted on:

Wednesday 2nd January 2013
View Replies!

using ascx controls

I want to have just one page "default.aspx" and then load all other content into a placeholer depending on what was chosen from the menu.In the DB I have a table tbl_modules which gives the name and path of the ascx files.so the URL would look something like default.aspxmodule=ModIDThis is easy enough with records to a grid but I just can't figure out the best way (or any way) to retrieve the value from the DB table and put it into the placeholder. help appreciatedMany
VIEWS ON THIS POST

69

Posted on:

Wednesday 2nd January 2013
View Replies!

Edit form in asp.Net when I have a lookup field

hi I have a Datagrid where I click on the id to open another aspx page to edit the selected record. I was able to pass the selected row's id\tand use it in the second page to pull the record into an edit form. The issue I am facing is I have a lookup field in the selected record and I got stuck not knowing how to show the user the values in the combo box for his/her selection in the edit mode
VIEWS ON THIS POST

307

Posted on:

Wednesday 2nd January 2013
View Replies!

user control postback not firing

I have a radiobuttonlist, dynamically created, which implements postback.If I place this directly onto a page it works great.But, if I place it onto a user control page and then place this user control onto a page the postback does not fire.It appears I am not setting the ID's properly. If this is the case, what are the rules for setting ID's on dynamically created controls so they work on both pages and embedded pagesMany
VIEWS ON THIS POST

78

Posted on:

Wednesday 2nd January 2013
View Replies!

instert into MS access with asp.net/vb

experts,I'm a newbee to ASP.NET.\tAnd I have been struggling solving this problem.\tBut I can't do it.\tCan you please help me get over this wall\tBelow is the code and error message:\t\t\t\t\t\tRegisterForm\t\t\t\tSub SubmitBtn_Click (Source As Object, ByVal E as EventArgs)\t\tdim listError as string\t\tdim connectionString as string\t\tconnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myProject\WebApplication1\UserDB1.mdb;"\t\tdim objConn = New OleDbConnection( connectionString )\t\tdim objCommand\t\ttry\t\t\t\tobjConn.Open()\t\t\t\tdim InsertSQL as string\t\t\t\tResponse.Write("Connection established! ")\t\t\t\t\t\t\t\tdim fname as string\t\t\t\tdim lname as string\t\t\t\tdim sname as string\t\t\t\tdim eml as string\t\t\t\tdim pwd as string\t\t\t\tdim sex as string\t\t\t\tfname=FN.text\t\t\t\tlname=LN.text\t\t\t\tsname=ScreenName.text\t\t\t\teml=Email.text\t\t\t\tsex=Request.Form("Sex")\t\t\t\tpwd=Password.text\t\t\t\t\t\t\t\t'Create Insert statement\t\t\t\tInsertSQL ="insert into Users (Email, FirstName, LastName, ScreenName, Sex, Password) "\t\t\t\tInsertSQL = InsertSQL & "values('" & eml &"', '" & fname &"', '" & lname &"', '" & sname &"','" & sex & "', '" & pwd &"');"\t\t\t\t\t\t' Create OleDbCommand object\t\t\t\tdim cmdInsert as New OleDbCommand(InsertSQL, objConn)\t\t\t\tcmdInsert.ExecuteNonQuery()\t\t\t\t\t\tResponse.Write("Data Recorded")\t\t\t\t\t\tcatch Err as Exception\t\t\t\tlistError = Err.ToString()\t\t\t\tResponse.Write(listError)\t\t\t\tend tryEnd Sub\t\t\t\tERROR:System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at ASP.RegisterForm_aspx.SubmitBtn_Click(Object Source, EventArgs E) in C:\myProject\WebApplication1\RegisterForm.aspx:line 39 Line 30 contains:\tcmdInsert.ExecuteNonQuery()\t\tThank you for your time,
VIEWS ON THIS POST

78

Posted on:

Wednesday 2nd January 2013
View Replies!

Waring: Page Expired

When a user hits the back button, how do you have the "Warning: Page Expired" message appearWe've tried using the Response.Cache object, without success.
VIEWS ON THIS POST

78

Posted on:

Wednesday 2nd January 2013
View Replies!

Retrieving check box value in ASP.NET

OleDbConnection myConnUserID1 = new OleDbConnection(strDSNUserID); OleDbCommand myCmdUserID1 = new OleDbCommand(strSqlUserID, myConnUserID1);OleDbDataReader drUserID1 = null; myConnUserID1.Open();drUserID1 = myCmdUserID1.ExecuteReader(); \t\t\t\tif(drUserID1.Read()) {txtUserName.Text\t= drUserID1.GetString(4); txtUserID.Text\t\t= drUserID1.GetString(0);txtPassword.Text\t= drUserID1.GetString(1);txtEmail.Text\t\t\t= drUserID1.GetString(16);lblDealerDesc.Text = drUserID1.GetString(11);if(drUserID1.GetString(63) == null){\t\tInternaluser.Checked =false;}else{\t\tInternaluser.Checked =true;}}I am getting the error is given below,The data value could not be converted for reasons other than sign mismatch or data overflow. For example, the data was corrupted in the data store but the row was still retrievable. Here I want to retrieve the internal check box value from database and assign value back to the check box in the web form. But I am not able to see the value for drUserID1.GetString(63)..Give me some good suggestion on this
VIEWS ON THIS POST

80

Posted on:

Wednesday 2nd January 2013
View Replies!

editable dropdownlist box

is there a property to allow the dropdownlist box become 'editable'\t
VIEWS ON THIS POST

175

Posted on:

Wednesday 2nd January 2013
View Replies!

OnItemCommand event not firing for Repeater?

Nevermind, I figured it out.\tI was dynamically loading my UserControls based on the user type of the application and was only doing so in the container page if IsPostBack=False.\tBecause of this the UserControl above wasn't being reloaded on PostBack when the ImageButtons were clicked and thus did not have the code behind, or the entire UC for that matter availible to process the button clicks.Mike
VIEWS ON THIS POST

52

Posted on:

Wednesday 2nd January 2013
View Replies!

Retrieving QueryString in Mobile Form

In the Page_Load routine in my mobile web page, I'm having trouble retrieving a caller ID from the calling browser.\tThe following line works in a conventional .aspx page, but not in my mobile page:\tlngDeliveryPersonID = Int32.Parse(HttpRequest.QueryString("DP"))The error message is:BC30469: Reference to a non-shared member requires an object referenceCan anyone advise
VIEWS ON THIS POST

78

Posted on:

Wednesday 2nd January 2013
View Replies!

Tiling Check Boxes

,gonna need to do this later this week, and thought I'd throw it out in case someone knows how to do it:I'm going to display a listing of checkboxes to the user. But I don't want it to be a vertical list. What I'd like is it to go accross a certain number, then start a new row. So if I have 9 checkboxes to display, it would look like:checkbox1\tcheckbox2\tcheckbox3checkbox4\tcheckbox5\tcheckbox6checkbox7\tcheckbox8\tcheckbox9I've played with the checkbox list before, but I don't recall it being able to do what I need. And worst case I could just dynamically build the checkboxes in the code behind and fill a table, but does anyone know of a cleaner way to achieve this
VIEWS ON THIS POST

85

Posted on:

Wednesday 2nd January 2013
View Replies!

Good book for learning ASP.net?

I am coming from a VB 6.0 background, and I have been enlisted by a friend to help build database driven web-site using MySQL and ASP.net (basically going to archive a bunch of documents online, and need to be able to access them on demand). Can anyone recommend a good book or two to help me pick up what I need to know
VIEWS ON THIS POST

143

Posted on:

Wednesday 2nd January 2013
View Replies!

Where Am I Going Wrong??????

I want to populate the records existing in SQL Server DB table in a DropDownList. This is what I have done:Sub Page_Load(obj As Object,ea As EventArgs)Dim objDS As DataSetDim objConn As SQLConnectionDim objDapter As SQLDataAdapterobjConn=New SQLConnection("Server=(local);Database=DBName;UID=sa;PWD=")objDapter=New SQLDataAdapter("SELECT CName,FDate FROM Company ORDER BY CName,FDate",objConn)objDS=new DataSet()objDapter.Fill(objDS,"Comp")cname.DataSource=objDS.Tables("Comp").DefaultViewcname.DataBind()End SubBut I am getting an error which says "Code blocks are not supported in this context" which points to the line. Where am I erring How do I rectify it
VIEWS ON THIS POST

73

Posted on:

Wednesday 2nd January 2013
View Replies!

Css after postback

I'm using a css on my project. I'm linking the css with my aspx with the link tag:Everyting work fine, until the page is posted back. Then, it looses all styles and colors, like if it wasn't linked to the css file. Is there any way to force a link after a postback, or to avoid loosing the link NetAngel
VIEWS ON THIS POST

76

Posted on:

Wednesday 2nd January 2013
View Replies!