Creating a New Text Box Class


,

Got an interesting project that I'd love your input on:

I find myself needing the web controls to have some sort of extra "Key" property, kinda like the old VB6 controls had, so that I can uniquely identify each control (the id property just doesn't cut it).

Anyone have any ideas, thoughts, or experience with inheriting from an existing control class, but adding more to it and creating your own (and I don't really mean a user control, as I don't want a whole page, just the text box)
Posted On: Wednesday 2nd of January 2013 02:29:48 AM Total Views:  384
View Complete with Replies

RELATED TOPICS OF ASP.NET PROGRAMMING LANGUAGE




AJAX Autocomplete Extender

Moved to ASP.NET forum. You will get a better response in this forum.
VIEWS ON THIS POST

275

Posted on:

Friday 16th November 2012
View Replies!

JavaScript & CustomValidator Control

On a page I have a Repeater control, in the Repeater control I have an ItemTemplate which is CheckBox. As the Repeater is being bound it generates a CheckBox for each name in the contact list. I am trying to determine if the user selected at least 1 contact, I get the alert but the page posts back anyways. My CustomValidator looks like: My Javascript function (CheckContacts) liiks like: function CheckContacts(source, args) { var ctrl = 'repContacts'; var cbName = 'cbSelect'; var objForm = document.form1; var errorCount = 0; var ctrlName = ctrl + '__ctl1_' + cbName; var chkBox = document.getElementById(ctrlName); if(chkBox == null) { alert ('There was an issue checking the *'+cbName+'* check box in the *'+ctrl+'* control'); return errorCount; } var isChecked = false; var i = 1; // Notice the 1, its important to get the start number correct ctrlName = ctrl + '__ctl' + i + '_'+ cbName; var curItem = document.getElementById(ctrlName); if(null == curItem) { alert ('It was null'); // something is wrong. Probably one of the 'Customize Values' } while (curItem != null) { //to check items inside the DataGrid/Repeater //using the != null check should keep it from getting locked up if (curItem.checked == true) { isChecked = true; } //increment i AND get the next control i += 1 ; ctrlName = ctrl + '__ctl' + i + '_'+ cbName; curItem = document.getElementById(ctrlName); } if (isChecked == false) { source.errormessage = 'Your need to select at least 1 contact in your list'; errorCount+=1; } if (errorCount > 0) { args.IsValid = false; } else { args.IsValid = true; } } Alone I get no alert if no contact is selected. If I add code to the code behind that adds an onclick Event to my button like so: btnWriteMessage.Attributes.Add("onclick", "return CheckContacts()"); I get my alert but the page still submits, which is what Im trying to stop. This is my first attempt (believe it or not) at using a CustomValidator control, so anyone got any ideas
VIEWS ON THIS POST

176

Posted on:

Friday 16th November 2012
View Replies!

Changing the browser URL

I am making a simple login system, then if the users details are correct, it will navigate to a different website (example: Google) This is my code so far using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { string password; protected void Page_Load(object sender, EventArgs e) { StreamReader passwordStream = new StreamReader(@"K:\Uni (Year 3)\EJ315020S - Windows Application Devlopment\Projects\AssignmentProgram\LoginSystem\password.txt"); while (passwordStream.Peek() >= 0) { password = passwordStream.ReadLine(); } } protected void Button1_Click(object sender, EventArgs e) { if (TextUsername.Text == "Jbloggs") { if (TextPassword.Text == password) { } } else { } } } } i have searched for it, but all i can find is things about "URL Routing"
VIEWS ON THIS POST

264

Posted on:

Friday 16th November 2012
View Replies!

Runtime Window Form creation

Hi Friends, In my application i want to create a window form at runtime and save this newly created form in my current root directory. so that i can access that form in future. So, if any one has any idea how to do this then please help me. Here is the code what i did : Form f = new Form(); f.Name = "Frm_Test"; f.Text = "Test Form"; f.Show(); I can able to create a form dynamically but i did not know how to save this created form.
VIEWS ON THIS POST

209

Posted on:

Friday 16th November 2012
View Replies!

Using Web Services for Flash AS3 with asp.net

i am doing a game project on chinese checkers. I am using Flash Cs3 professional to program my project. all in actionscript 3.0. For my database and website, i used asp.net and sql server. I used IIS 5.1 also. I found out that Actionscript 3.0 do not support web services. i want to pass my data from flash to asp.net to store into database. Do anyone have any solutions
VIEWS ON THIS POST

295

Posted on:

Friday 16th November 2012
View Replies!

pagination in asp.net using c#

how to pagination in asp.net using c# coding
VIEWS ON THIS POST

271

Posted on:

Friday 16th November 2012
View Replies!

Session problems

Problem still exists but found out some new Information. Running IE 7.0.5730.11 from any XP machine, the above session problem holds true. Running it from Vista IE 7.0.6001.18000 it works the way I need it to. I have tried several windows XP machines some with servicepack 3 and others with only service pack 2. It doesnt really matter what updates are on it, the application still ends the session. "Still waiting for the brave willing soul to venture forth and delve into this problem."
VIEWS ON THIS POST

256

Posted on:

Friday 23rd November 2012
View Replies!

Allow users to create files dynamicly

I'm looking to allow a specific role on the site to create pages (through the ui I create). By default asp.net doesnt grant this permission. How would I allow the role permissions to write files
VIEWS ON THIS POST

217

Posted on:

Friday 23rd November 2012
View Replies!

trying to choose multiple files for uploading

Hi to alli am trying to do a multiple file upload functionI use a input control : when i run the Web Aplication and click in the associated input button, it opens an "explorer" to choose the file that is going to be uploaded.but i can choose only one.Is there a way that enables me to choose more then one file\ti saw other solutions but they all implicate a fixed number of
VIEWS ON THIS POST

228

Posted on:

Sunday 25th November 2012
View Replies!

ASP.NET 2.0 Data Cache sort problem

I query a table that creates a dataset in "lastname" order. I then bind the table to a datagrid that displays the data in the proper "lastname" order. When I move to a "record layout" page I create a datatable from the Cached table and I want to navigate is "lastname" order. Instead, the navigation is in "emp_id" order.GRIDEMP_ID\tLASTNAME\t\tFIRSTNAME5\t\t\t\t\t\t\tA\t\t\t\t\t\t\t\tJOAN3\t\t\t\t\t\t\tB\t\t\t\t\t\t\t\tJOHN1\t\t\t\t\t\t\tC\t\t\t\t\t\t\t\tKEVIN\tAFTER RESTORING CACHE IN RECORD LAYOUT I GET THIS ORDEREMP_ID\tLASTNAME\t\tFIRSTNAME1\t\t\t\t\t\t\tC\t\t\t\t\t\t\t\tKEVIN3\t\t\t\t\t\t\tB\t\t\t\t\t\t\t\tJOHN5\t\t\t\t\t\t\tA\t\t\t\t\t\t\t\tJOAN\tPage 1 (contains grid)strSQL\t= "SELECT emp_id, lastname,firstname"strSQL += " FROM EMPLOYEES ORDER BY lastname"dstSearch\t= New DataSet()conPubs\t\t= New OleDbConnection(connection_string)dadSearch\t= New OleDbDataAdapter(strSQL, conPubs)dadSearch.Fill(dstSearch, "C_EMPLOYEES")dtblSearch = dstSearch.Tables("C_EMPLOYEES")dgrdEmployees.DataSource = dstSearchdgrdEmployees.DataBind()Cache("CACHED_TABLE") = dtblSearchStep 2. On the grid I have a "Select" link that shows a page\twith detail about the employee. On the forms are and buttons.\tWhen I press the next and prev buttons, the cached data moves in "emp_id" order rather than last name.Page 2 Record LayoutSub Record_View()Dim dtblTemp\t\tAS DataTableDim dvwRecord\t\tAS DataViewDim RowIndex\t\tAS IntegerDim numrows\t\t\tAS INTEGER\t\t\t\tSESSION("PREV")\t= 0SESSION("NEXT")\t= 0SESSION("FIRST") = 0SESSION("LAST")\t= 0dtblTemp\t\t= Cache("CACHED_TABLE")numrows\t\t\t= dtblTemp.Rows.Count-1SESSION("FIRST") = dtblTemp.Rows(0).Item("EMP_ID")SESSION("LAST")\t= dtblTemp.Rows(numrows).Item("EMP_ID"))dvwRecord\t\t\t= dtblTemp.DefaultView()dvwRecord.Sort = Session("LASTNAME") RowIndex\t\t\t= dvwRecord.Find("EMP_ID"))\t\t\t\tIF RowIndex -1 THEN\t\tIF RowIndex > 0 THEN\t\t\tSESSION("PREV") = dvwRecord(RowIndex-1).Row(EMP_ID"))\t\tEND IF\t\tIF RowIndex dtblTemp.Rows.Count-1 THEN\t\t\tSESSION("NEXT") = dvwRecord(RowIndex+1).Row("EMP_ID"))\t\tEND IFEND SUB
VIEWS ON THIS POST

346

Posted on:

Tuesday 27th November 2012
View Replies!

Tooltip for a database driven listbox

Is there a way to make a tooltip for a database driven listbox without using client side codeWhen not does anybody know a way to develop thisThx
VIEWS ON THIS POST

246

Posted on:

Tuesday 27th November 2012
View Replies!

write a program to ping a series of IP addresses

Steve, you can use the xp_Cmdshell extended Stored procedure if you are using SQL Server.CODExp_cmdshell 'PING 127.0.0.1'Try that in Query Analyzer with some different IP addresses and you should get back several rows depending on the results.\tFrom those results you should be able to get all the info you need.You could probably write your own sproc to do this and ping a list of preconfigured ips.
VIEWS ON THIS POST

328

Posted on:

Tuesday 27th November 2012
View Replies!

Can web form perform drag and drop?

Can web form perform drag and drop
VIEWS ON THIS POST

228

Posted on:

Tuesday 27th November 2012
View Replies!

make label text invisible after 3 minute?

I use label as message bar. Is it possible to make label text invisible after 3 minute
VIEWS ON THIS POST

273

Posted on:

Tuesday 27th November 2012
View Replies!

Javascript functions stop working

Hi ,I need desperate help!!! I have an ASP.NET application that depends heavily on scripting. I was getting ready to put the website online (in a couple of days) when suddenly all the javascript that I have on the site stopped working. I'm running Windows 2000 Server, and the last thing I did was I went to Windows Update and downloaded over 25 updates for my machine, 18 of them critical. Other than that, I have done absolutely nothing so I'm suspecting that one of the updates messed me up. Does anybody know what may be happening
VIEWS ON THIS POST

311

Posted on:

Tuesday 27th November 2012
View Replies!

Problem with RichTextBox component

hello,I have a web application in which I want to use the functionalities of the RichTextBox component.I added it to my reference and import the system.windows.form.I use it like thismyRichTextBox as new RichTextBox()myRichTextBox.Rtf = "my RTF string"but I have the followinfg errorSystem.ComponentModel.Win32Exception: The class already existI don't know what's going on.Any Ideas\t
VIEWS ON THIS POST

193

Posted on:

Tuesday 27th November 2012
View Replies!

class for server variables

I'm looking to use request in some vb.net modules in my asp app. Which class is needed in order get access to the server variablesTIA
VIEWS ON THIS POST

235

Posted on:

Tuesday 27th November 2012
View Replies!

Newbie Questions

I've never used .net but I've got .net source code that i want to use. I'm currently running IIS 5.0. Is is as simple as using those files or do I need to install a program that will allow me to use .net programming
VIEWS ON THIS POST

227

Posted on:

Wednesday 28th November 2012
View Replies!

Unable to print report from the server

I have an app built in asp 2.0. It allows data entery and when the data is saved to a database, it prints a crystal report. This all works fine when I run it local on my machine. But when I publish it to the server, it bombs. Here is my code and the error message.CODE'**************** this is the code that actually prints the report\t\t\t\tDim myReportDocument As New ReportDocument\t\t\t\tmyReportDocument.Load(Server.MapPath(strReport))\t\t\t\tmyReportDocument.RecordSelectionFormula = "{command.RECORDID} = " & Session("ReportID")\t\t\t\tmyReportDocument.PrintToPrinter(1, True, 1, 99)Error Message:Error in File C:\WINDOWS\TEMP\CaseLogDoc {39507207-A58B-48F3-ABEA-8FE633E626D3}.rpt:Unable to connect: incorrect log on parameters. ProDev, MS Access ApplicationsVisit me at ==> http://www.prodev.usMay God bless you beyond your imagination!!!
VIEWS ON THIS POST

243

Posted on:

Tuesday 1st January 2013
View Replies!

Best Practice for DetailsView

Using .NET 2.0 and VS2005 I'm creating a new website and I'm trying to utilise the new controls and features were possible.At the moment I'm making a simple update / add record form and initially tried creating the textboxes and using a ObjectDataSource Control set to a TableAdapter to add the fields. This worked but I can't for the life of me work out how to read a record from the ObjectDataSource and populate the textboxes ready for an edit to occur. I'd still be interested in hearing how to do thisAnyway, so I decided to try the detailsview control. At first I couldn't work out how to validate it and add multiline textboxes, but some time playing with templates has got most of that ironed out. However I'm trying to work out the best practice for updating some default fields in the table that the user should not see in the details view. I have a field for modified date to enable basic auditing of the updates and want to update it with the current date and time when the user clicks the update command in the detailsview. How can I do this / what method is best advice greatly appreciated.Cheers, Steve G (MCP)
VIEWS ON THIS POST

238

Posted on:

Tuesday 1st January 2013
View Replies!

Crystal Report to PDF Problem in ASP.Net

Hi ,I have a problem.\tI need to generate a PDF from a crystal report on a web form.\tThats no problem, that works, but for some reason, my page behind the PDF disapears.\tWhat i mean is the page that made the request (even though it has the same URL) is blank and the PDF opens up in acrobat over the web page.my code CODE\t\tPrivate Sub cmdGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGenerate.Click\t\t\t\tExportReport()\t\tEnd Sub\t\t\t\tSub ExportReport()\t\t\t\tDim oStream As New MemoryStream ' // using System.IO\t\t\t\t' Select Case format\t\t\t\t'\t\t\tCase "PDF"\t\t\t\toStream = cr.ExportToStream( _\t\t\t\t\t\t\t\t\t\tCrystalDecisions.Shared.ExportFormatType.PortableDocFormat)\t\t\t\tResponse.Clear()\t\t\t\tResponse.Buffer = True\t\t\t\tResponse.ContentType = "application/pdf"\t\t\t\t'--------------------------------------------------------------\t\t\t\tTry\t\t\t\t\t\tResponse.BinaryWrite(oStream.ToArray())\t\t\t\t\t\tResponse.End()\t\t\t\tCatch err As Exception\t\t\t\t\t\tResponse.Write("< BR >")\t\t\t\t\t\tResponse.Write(err.Message.ToString)\t\t\t\tEnd Try\t\tEnd Su
VIEWS ON THIS POST

193

Posted on:

Tuesday 1st January 2013
View Replies!

ListBox Javascript

Does anyone have Javascript for limiting the number of selected items (lets say to 5) in a multi-select ListBox using ASP.NET
VIEWS ON THIS POST

167

Posted on:

Tuesday 1st January 2013
View Replies!

Lost SQLDataAdapter on page design

Hi ALL,For some reason, I've lost my SQLDataAdapter, SQLConnection, and Dataset icons that appear at the bottom of the design page.\tOf course, I need these to make property changes.\tAnyway, I closed VS and reopened it, but it didn't make any difference.\tThe version I am using is:\tMicrosoft Visual Basic .NET\t69461-270-0000007-18910Has anyone seen this before\tAny thoughts, ideasTIA, Randy
VIEWS ON THIS POST

580

Posted on:

Tuesday 1st January 2013
View Replies!

Creating Dataset via Data Adapater OR DataTable Programmatically

Your help is appreicated, I am reading .Net and got confused. Data Adapter (DA)can create DataSet with one or more Datatable\t(DT)by using the DA method ( Fill). However, DS and DT can also be created programmatically.I find it easier to use DA.Fill. So my question, why would a developer\tcreate Ds and DT programmatically and what added advantages would he/she gains
VIEWS ON THIS POST

215

Posted on:

Tuesday 1st January 2013
View Replies!

FolderBrowserDialog

I am trying to use the FolderBrowserDialog option to allow users to browse for a folder. I can't seem to get it to import System.Windows.Forms which I assume I need - it says: Namespace or type...cannot be found.I am using VB.NET and .NET v1.
VIEWS ON THIS POST

182

Posted on:

Tuesday 1st January 2013
View Replies!

Multiple URLS on Application

I wanted some help on where to start with the following project design. I want to develop a cms type site which allows multiple customers to register and have a CMS driven website. Each site would be a single asp.net application which loads the data on something like a cutsomerid. So I plan to have www.mysite.com/about.aspx which loads the content based on the customerid either from querystring or session value. Another option I was toying with was giving each customer a subdomain so customer1.mysite.com which points to the app but it works out the content to display based on the subdomain.I don't really know what technologies to research in .net to do this. The most complex example might be customers who wish to point their domain to my system, so it looks as though it's there own site but it's still my application as the engine underneath. How would I need to design the setup for this scenario Steve G (MCSE / MCSA:Messaging)
VIEWS ON THIS POST

213

Posted on:

Tuesday 1st January 2013
View Replies!

Executing code in container page from user control

I have a user control that acts as a lookup button in that when clicked it presents the user with a list of choices from a database query.\tThe user then selects the row they dee.The easy part is I can set a hidden control or public variable to the key of the record they selected.What I want to do as part of this click event is to then use this key in the container page, read the selected row and populate additional text boxes on the container page.How do I execute or trigger the execution of code in the container page when the button is clicked in the user controlTIAMark
VIEWS ON THIS POST

247

Posted on:

Tuesday 1st January 2013
View Replies!

Problem configuring a ODBC datasource

Hi. I'm using VS2008. My problem is that I need to configure my ODBC data source with a custom stored procedure, but when I get to the "define custom statements or stored procedures" page in the configure wizard, stored procedures bullet is greyed out.\tI need to use this data source to populate a gridview
VIEWS ON THIS POST

310

Posted on:

Tuesday 1st January 2013
View Replies!

Replacing/Adding single quotes for values in WHERE clause

,I have a strSQL statement where I'm taking in arguments that are building the 'IN' part of my WHERE clause. For example:CODE\t\t\tstrSQL = "SELECT " & _\t\t\t\t\t\t\t\t"invoice.invoice_num, " & _\t\t\t\t\t\t\t\t"invoice.invoice_date, " & _\t\t\t\t\t\t\t\t"pickup.zip_code, " & _\t\t\t\t\t\t\t\t"delivery.company_name, " & _\t\t\t\t\t\t\t\t"job.weight, " & _\t\t\t\t\t\t\t\t"job.dim_weight, " & _\t\t\t\t\t\t\t\t"WHERE " & _\t\t\t\t\t\t\t\t" invoice.invoice_date = '" & dttmStart & "' AND " & _\t\t\t\t\t\t\t\t" invoice.cust_code IN '" & strCustCodeList & "'"The strCustCodeList is taking in values from the database table as such: 123454,123456,123457Can someone please show me how to form this string so it will come in as such: ('123454','123456','123457') with the single quotes Unfortunately, these are varchar values in the database and dong a cast or convert on these is not an option either.
VIEWS ON THIS POST

137

Posted on:

Tuesday 1st January 2013
View Replies!

ASP.NET page on Win 2003 intranet to remotely reboot another server

I posted this to the ASP forum, but there's no reason an ASP.NET solution shouldn't work, so I'll restate here.I have two Windows 2003 servers, a primary that runs both a database and intranet, and a secondary that runs terminal services for a custom 3rd party application that accesses the database on the primary server.Every once in a while, the 3rd party app ceases to operate normally, and it will not function until the terminal server is rebooted.\tThis invariably happens when there is no one around to restart the terminal server.What I'd like to do is to give my intranet users the ability to reboot the terminal server from a web page.\tI've created a form on an ASP page that attempts to run a batch file upon submittal.\tThe batch file contains the SHUTDOWN command ("c:\windows\system32\shutdown.exe -r -m \\ts-server -t 30 -f"), but I can't get the VBScript inside the web page to execute the batch file.\tThe batch file itself executes properly if run from the command line.\tThis could easily be replaced with ASP.NET and appropriate commands, but I don't know where to start.I've received several errors upon several attempts with ASP.\tMy most recent error is: \t\tMicrosoft VBScript runtime error '800a0046'\t\tPermission denied\t\t/reboot.asp, line 31Line 31 is the wshell.run below:CODEset wshell = CreateObject("WScript.Shell") wshell.run "c:\inetpub\wwwroot\reboot.bat" set wshell = nothing I tried to set security on reboot.asp as follows:IIS Manager > reboot.asp Properties > File Security > Authentication and access control > Edit > use administrator account for anonymous accessThis also produces the same error detailed above.I also tried setting the IUSR account with Read and Execute rights for reboot.bat, reboot.asp, shutdown.exe and cmd.exe. I'm not even sure if this is the best approach, but has anyone had success or attempted to do this themselves\tAny guidance or advice is appreciated.
VIEWS ON THIS POST

192

Posted on:

Wednesday 2nd January 2013
View Replies!

Return a Datareader from a function

HiI often use datareaders to populate drop-down boxes etc.\tI generally return a datareader from a class/function with the commandbehaviour.closeconnection, and then close the actual datarader connection in the consuming function of where it gets passed to.Does anyone see any data access design issues with this
VIEWS ON THIS POST

201

Posted on:

Wednesday 2nd January 2013
View Replies!

UserControl caching

I am hosting a usercontrol on a masterpage that builds a dynamic menu based on the user name I retrieve based on the user's windows logon.\tI have a table in the database that retrieves role information based on their logon id.I want to display this usercontrol based on the user's logon, which I have captured in a session object.\tDifferent users will have different menu items based on their role in the database.I am not using the menu control shipped with ASP.NET.\tI'm using an Oracle database, which doesn't lend itself well to building a membership provider.How should I approach building a fragment cached user control in this scenario that display a different cached user control based on the user's logon
VIEWS ON THIS POST

178

Posted on:

Wednesday 2nd January 2013
View Replies!

Web Learning Question

to my fellow developers.I'm an applications guy wanting to learn web development.\tI had someone tell me I needed to get a few things under my belt like soap, AJAX, web services, XML, and e-commerce.What's the order of learning here I'm not starting from scratch but I feel like I am.\tWhat to learn firstHow does it all fit together.Microsoft's site speaks in another language all together.Is there a bigger market for C# Sorry, don't mean to ask that here, but it's relevant
VIEWS ON THIS POST

181

Posted on:

Wednesday 2nd January 2013
View Replies!

Disable enter button, except within TextAreas

Is there a way to disable the action of the enter button except when the focus is within certain text boxes "...your mom goes to college..."
VIEWS ON THIS POST

105

Posted on:

Wednesday 2nd January 2013
View Replies!

Switching out a web site?

We currently have a web site up and running on a w2K server using IIS 5.0. We have done a complete re-write of the site and want to switch out the current one with the new one. If we change the home directory to the new web site, stop and start IIS... would that be it or is there more to it
VIEWS ON THIS POST

582

Posted on:

Wednesday 2nd January 2013
View Replies!

Adding controls at runtime

\tA better way to handle this would be to create individual objects and add the textboex etc, to the table cell, then add the tablerow then add the table to the page. , you need to set up another variable to keep track of how many controls you have because with each postback you must recreate all programmatically created controls.ie\tyou hit add 1 time, checking control variable count, its at 0 right now, so set variable to 2, loop through control creation code.hit add button again.\tretrieve control creation variable.\tvalue is currently 2, add 2 more to it, then do your loop to create.\tetcetc. , here is part of my code in a submit onclick event where i get my textbox values.\tyou must create textbox controls to get their values - you canty refernce them by name.sorry this is in C# but you'll get the ideaCODE\t\tprotected void cmdSumbit_Click(object sender, ImageClickEventArgs e)\t\t{\t\t\t\t// get dynamic textbox for phonenumbers values\t\t\t\tint n = Int32.Parse(Session["NumberOfPhones"].ToString());\t\t\t\tstring[] strPhoneValues = new string[n];\t\t\t\tstring[] strPhoneIDValues = new string[n];\t\t\t\t\t\t\t\tfor (int x = 0; x < n; x++)\t\t\t\t{\t\t\t\t\t\tstring boxName = "txtPhoneNumber" + (x + 1);\t\t\t\t\t\tstring idboxName = "txtPhoneID" + (x + 1);\t\t\t\t\t\tstrPhoneValues[x] = ((TextBox)FindControl(boxName)).Text;\t\t\t\t\t\tstrPhoneIDValues[x] = ((TextBox)FindControl(idboxName)).Text;\t\t\t\t}\t\t\t\t// get dynamic textbox values\t\t\t\tDataSet ds = DatabaseFunctions.GetOrgItems(Convert.ToInt32(Session["SiteID"]), "OrganizationData");\t\t\t\tint i = Int32.Parse(ds.Tables[0].Rows.Count.ToString());\t\t\t\tstring[] strFieldName = new string[i];\t\t\t\tstring[] strFieldNameValues = new string[i];\t\t\t\tint y = 0;\t\t\t\tforeach(DataRow dr in ds.Tables[0].Rows)\t\t\t\t{\t\t\t\t\t\tstring strfieldName = dr["fieldname"].ToString();\t\t\t\t\t\tstring strfieldNameValues = "txt" + dr["fieldname"].ToString();\t\t\t\t\t\tstrFieldName[y] = strfieldName;\t\t\t\t\t\tstrFieldNameValues[y] = ((TextBox)FindControl(strfieldNameValues)).Text;\t\t\t\t\t\ty++;\t\t\t\t}........ , on which line do you get the error , Of course the problem is that controls created at runtime have to be recreated each postback and won't maintain viewstate unless they're recreated in Page_Init\tSo here's the solutionCODEPrivate Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init\t\tInitializeComponent()\t\tDim myTextbox As TextBox\t\tDim myRow As TableRow\t\tDim myCell As TableCell\t\tIf Not IsPostBack Then Session("TextBoxCount") = -1\t\tFor counter As Integer = 0 To Session("TextBoxCount")\t\t\t\tcreateTextBox(counter)\t\tNextEnd SubPrivate Sub myButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles myButton.Click\t\tSession("TextBoxCount") += 1\t\tcreateTextBox(Session("TextBoxCount"))End SubPrivate Function createTextBox(ByVal iIndex)\t\tDim myTextbox As TextBox\t\tDim myRow As TableRow\t\tDim myCell As TableCell\t\tmyTextbox = New TextBox\t\tmyTextbox.ID = "txtMine" & iIndex\t\tmyCell = New TableCell\t\tmyCell.Controls.Add(myTextbox)\t\tmyRow = New TableRow\t\tmyRow.Cells.Add(myCell)\t\tmyTable.Rows.Add(myRow)End FunctionNow your textboxes are created before viewstate is applied to the controls so you can let Microsoft handle it.\tLet me know if this works out for you.
VIEWS ON THIS POST

474

Posted on:

Wednesday 2nd January 2013
View Replies!

user input form

hello, i am trying to create a user input form that links to a database, everything is working fine apart from one problem... There is a field called "DateJoined" and i want the page to load with the current system date already in the dateJoinedTextBox!I am writing in ASP.net 2.0 using Access as my DBMS!!so far i have worked out aq way to get just the date using a javascript function:CODEvar currentTime = new Date()var day = currentTime.getDate()var month = currentTime.getMonth() + 1var year = currentTime.getFullYear()document.write(day + "/" + month + "/" + year)but i cant get it into my text box in anyway cos it won't allow code between the tags and i am using templateFileds but am not sure how to do it!code for DateJoined TemplateField:CODE\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tany help would be great!
VIEWS ON THIS POST

153

Posted on:

Wednesday 2nd January 2013
View Replies!

CSS Control Adapters

Has any one ever used CSS Control Adapters How do you install it in to VS 2005.netBabloome
VIEWS ON THIS POST

271

Posted on:

Wednesday 2nd January 2013
View Replies!

Secure payment using ASP.NET

I'm going to be building my first e-Commerce site so haven't ever integrated credit card payment processing into a web site. Assuming I already have access to secure web space, does anyone know any good tutorials for integrating credit card payment procesing into an ASP.NET (C# preferably) web site
VIEWS ON THIS POST

97

Posted on:

Wednesday 2nd January 2013
View Replies!

how define demension dynamically

I have on a Default.aspx this tag:...................Now i will to make the height of the image dynamically:PS:myParameter is a Parameter, which i retrieve it from database 1-How do thisWhere should be myParameter defined, in Default.aspx or in codebehind....2-Is There maybe better technique in\tto define the Hight instead of to write\tstyle="height:250px ,i mean some other controll, Grid or whatever i dont know them!PS:i use C# as to write my Classes, codebehind a.s.
VIEWS ON THIS POST

261

Posted on:

Wednesday 2nd January 2013
View Replies!

Silent Refresh ?

Does anyone know how I can refresh an iframe w/o getting the annoying IE 'Tick' noise-Rick VB.Net Forum forum796\t\tforum855 ASP.NET Forum\t\tI believe in killer coding ninja monkeys.
VIEWS ON THIS POST

114

Posted on:

Wednesday 2nd January 2013
View Replies!

Login Failed for user

I'm trying to connect to a database on my local machine, but I keep getting the error: Login failed for user 'DEV6\IUSR_DEV6'.This is the connection string I am using:CODE"Data Source=(local);initial catalog=favorites;Trusted_Connection=yes;Integrated Security=SSPI"I have the following entries in my web.config:CODE\t \tIn the Security Logins, in the sa account under authentication both Windows Authentication and SQL Server Authentication are greyed out there is no way to select either one.When I created the database, I selected both windows and SQL Server Authentication, but I still get the error when I try to login.I can make a successful connection with Access, with UDL, and with the Data Sources (ODBC), but no connection string that I try will work with asp.net -- it seems to be some config problem with vs.netCan anyone help me out here
VIEWS ON THIS POST

223

Posted on:

Wednesday 2nd January 2013
View Replies!

Datagrid not displaying results??

When the page loads I get no errors, but nothing displays to the screen - please help as I am an extreme newbie to dot net.CODEProtected Sub Page_Load'Get date and time to display to screenDim dtNow As DateTime = DateTime.NowDisplayDate.text = dtNow.ToString( "D" )\t\t\t\t'Query tbl_TraverTracker in Intranet DB on ESSPITSRV01 and bind data to 'label TripsDim myConn AS New SQLConnection("SERVER=esspitsrv01;DATABASE=intranet;UID=sa;PWD=PRD$3PES$;")myConn.Open\t\t\t\tDim strSql AS String = "SELECT * FROM tbl_TravelTracker ORDER BY TripNumber"Dim myCommand AS New SQLCommand(strSQL, myConn)\t\t\t\tDim myDataReader AS SQLDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)\t\t\t\t'Bind DataTrips.DataSource = myDataReaderTrips.DataBind\t\t\t\tMyConn.close()\t\t\t\tEnd SubDatagridCODEI've been beating my head in here for an hour - any help is highly appreciated!!
VIEWS ON THIS POST

126

Posted on:

Wednesday 2nd January 2013
View Replies!

HELP production website BAD ERROR

We deployed our new website over the weekend (from peal and PHP to .NET) and non of the asp buttons click events are causing a post back. They are however validating the text boxes on the form. This works in development. I created 1 web form with 3 user controls that hide and unhide depending on what was clicked on the left. Each User control is actually used as a form for our customers to get more information, CDs sent to them ect this form of sorts has text boxes and other asp controls with validation controls. They also have a submit button.In DEVELOPMENT when running in visual studio I can click on the submit which causes validation (client side) then causes a post back where my code runs ... all is swell.On our HOSTED site you can click the submit button validation fires but NO post back HELP !!!! I have sales and marketing hunting me down I am on the runCheck it out http://www.gyrus.com/3ColumnForm.aspxPAGENAME=Pro...This is a problem with all the submit buttons. SO as it stands now our customers can not login HELP
VIEWS ON THIS POST

192

Posted on:

Wednesday 2nd January 2013
View Replies!

How to access Secure Web Site using WINHTTP

Hi i wrote down the following code to connect to a secure web site using WINHTTP,but i am getting "security error",although i can access some other websites with this code but when i am trying to connect to Secure Web Site with the client certificate i am getting the above error.
VIEWS ON THIS POST

91

Posted on:

Wednesday 2nd January 2013
View Replies!

Web Access Failed Dialog Box mystery

In trying to create or open a previous ASP.Net applications, I get the following error dialog:The default Web access mode for this project is set to file share, but the project folder at 'http://localhost/WebApplication1 cannot be opened with the path 'c:\inetpub\wwwroot\WebApplication1'. The error returned was:Unable to create Web project 'WebApplication1'. The file path 'C:\inetpub\wwwroot\WebApplication1' does not coorespond to the URL 'http://localhost/WebApplication1'. The two need to map to the same server location. HTTP Error 404: Object Not Found.I've waded through the online and offline help and I can't seem to sort out the problem. The only thing that has changed since successfully working is that I've installed and un-installed php for a small project
VIEWS ON THIS POST

111

Posted on:

Wednesday 2nd January 2013
View Replies!

Checking if a dataset is empty

I use a session variable to store the data filled in three form pages registration. On every page I create a dataset with a table object in it and then I assign the dataset to the session. If the user decides going back to the previous form page I want to refill all the form fields with the data stored in the session, now I am trying to do it thus on the second page: (in the case of user comes from the third page)CODESub Page_Load(sender As Object, e As EventArgs)\tIf Not IsPostBack Then\t\tDim ds2 As DataSet\t\tds2 = CType(Session("UserData"), DataSet)\t\t\t\tIf Not isNothing(ds2.tables(0).rows(0)) then\t\t\t\t\t\t\tname.Text() = ds2.Tables(0).rows(0).Item("companyName").ToString\t\t\t\t\t\t\tstate.SelectedValue = ds2.Tables(0).rows(0).Item("State").ToString\t\t\t\t\t\t\t\t\t\tcity.SelectedValue = ds2.Tables(0).rows(0).Item("city").ToString\t\t\t\t\t\t\t\t\t\t...\t\t\t\tEnd If\tEnd IfEnd SubBut I receive this error just when I come normally from the first page to the second: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.Line 73: state.SelectedValue = ds2.Tables(0).rows(0).Item("State").ToStringI don t understand this error because the subroutine says that only set the values from the session to the form fields if the data exists in the dataset: 'If Not isNothing(ds2.tables(0).rows(0)) then'. And if I come from the first page the dataset of the second page it doesn t exists yet...Somebody knows what is the problemOn the first form page:CODESub userData(Sender As Object, e As EventArgs)\t\tDim ds As New DataSet() \tDim dt As New DataTable() \tdt.columns.add("Mail")\tdt.columns.add("Password") \tdt.columns.add("userType") \tdt.columns.add("zipCode") \tdt.columns.add("companyName")\tdt.columns.add("State")\tdt.columns.add("City")\t...Dim row As DataRow\trow = dt.NewRow()\trow.Item("Mail") = mail.Text\trow.Item("Password") = password.Text\trow.Item("userType") = userType.SelectedItem.Value\trow.Item("zipCode") = zip.Text\t\t\tdt.Rows.Add(row)\tds.tables.add(dt)\tSession("UserData") = ds End SubOn the second form page:CODESub userData(Sender As Object, e As EventArgs)\tDim ds2 As DataSet\tds2 = CType(Session("UserData"), DataSet)\t\tDim row As DataRow\trow = ds2.Tables(0).Rows(0)\trow.Item("companyName") = name.Text\trow.Item("State") = state.SelectedItem.Value\trow.Item("City") = city.SelectedItem.Value\t...\tSession("UserData") = ds2\tresponse.Redirect("Form3_NewUser.aspx")End SubThank you
VIEWS ON THIS POST

579

Posted on:

Wednesday 2nd January 2013
View Replies!

DataGrid not showing, why? (Snippet posted)

Please look at the code below and tell me why the data grid is not showing, only the label.
VIEWS ON THIS POST

65

Posted on:

Wednesday 2nd January 2013
View Replies!

Path to Image Files

I created a Folder within my project called images. when inserting images into my ASP app i set the image url = images/image.gifall of them show up except for the company logo I am trying to add. it's just a gif file like the others..can someone tell me where the best place to store pics is so I will not run into this problem againI know it has something to do with the path to the file but the path is no different from the rest of them that will show up..any help would be appreciate
VIEWS ON THIS POST

50

Posted on:

Wednesday 2nd January 2013
View Replies!