Has anyone ever seen this error?


Error: Object reference not set to an instance of an object

I am trying to set the datasource of a listbox on a form to the arraylist generated from a custom control.

My code looks like this:

Protected withevents listbox1 as System.Web.UI.WebControls.ListBox

Public Sub ListLoad (ByVal CntArray as arraylist)

\t\t\t\tDim CntArray As ArrayList = New ArrayList()

\t\t\t\tCntArray.Add("Sam")
\t\t\t\tCntArray.Add("Joe")
\t\t\t\tCntArray.Add("Mike")

\t\t\t\tListbox1.DataSource = CntArray
\t\t\t\tListbox1.DataBind()
End Sub , I have found my error. I needed to but the databinding in the page load event of the form. Everything seemed to work okay after that.
Posted On: Wednesday 2nd of January 2013 02:29:10 AM Total Views:  381
View Complete with Replies

RELATED TOPICS OF ASP.NET PROGRAMMING LANGUAGE




Web Content Management System

Dear Fellows, I got assignment to make a web content management system. Can any body suggest me best possible helping websites or e-books for this type of project. I am going to implement this project in ASP.NET. Good suggestions are always welcome. This post has been edited by sharoo: 10 December 2007 - 11:38 PM
VIEWS ON THIS POST

84

Posted on:

Friday 16th November 2012
View Replies!

html page calls default.aspx.vb and gets Ispostback false

I have an asp html page that allows the user to input data into a web page. When they click the submit button it calls a default.aspx.vb. The ISPostback is always false so it skips my sql add parameters. Here is the code: GDR Request Form jQuery(document).ready(function ($) { $("#txtCommercial").mask("(999) 999-9999"); }); Commercial: DSN: **************************************************** Default.aspx.vb **************************************************** Imports System.Data.SqlClient Imports System.Data Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Me.Load txtRequester_Date.Text = Date.Today txtRequestDate.Text = Date.Today If (IsPostBack) Then ' this creates the connection. Dim sqlConn As New SqlConnection("Data Source=JITC-PC\GEOINT; Initial catalog=DEV_GEOINT; Integrated Security=SSPI;") ' create the command object Dim sqlCmd As New SqlCommand("sp_InsertRequest", sqlConn) ' define the connection for the command object sqlCmd.Connection = sqlConn sqlCmd.CommandType = CommandType.StoredProcedure ' define the SQL parameter sqlCmd.Parameters.AddWithValue("@Org", txtOrganization.Text) sqlCmd.Parameters.AddWithValue("@REQ_Date", txtRequester_Date.Text) ' open the connection sqlConn.Open() ' execute the data insertion sqlCmd.ExecuteNonQuery() ' close SQL connection sqlConn.Close() ' dispose of the connection object (mostly optional but good practice) sqlConn.Dispose() ' Notify the submission was accepted Response.Write("Thank-you for your Request!") End If End Sub Private Function isempty(ByVal p1 As Object) As String Throw New NotImplementedException End Function End Class This post has been edited by Dormilich: 21 October 2012 - 01:18 AM Reason for edit:: fixed code tags
VIEWS ON THIS POST

350

Posted on:

Thursday 22nd November 2012
View Replies!

Show a PopUp image in page_load

Hi all.I am trying to do something like this: When a user opens my website, in my Page_Load of Default.aspx, I want to show a PopUp window with an image(that I will take from database).If user clicks 'X' button PopUp window will close. I tried extender of AJAX- ModalPopUpExtender but as I saw this is not a control itself but this is an extender for a control that fires an event(for example a button,linkButton,ImageButton etc) and I think this won`t work as a control(wich I would call from Page_Load event of my page,something like modalpopUp.Show() ). I hope you understand and you can help me. Thank You.
VIEWS ON THIS POST

178

Posted on:

Friday 23rd November 2012
View Replies!

excel sheet invalid index problem

hii i am new to this site.i am having a problem in my project.in which i have to delete an excel worksheet using asp.net c# code.There are 17 sheets in my workbook.I have used the following code for this: sheet1=(Excel.Worksheet)wb.Worksheets[1]; sheet1.Delete(); when i run my application it shows me error: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX). please help me on this.its really very urgent.
VIEWS ON THIS POST

288

Posted on:

Friday 23rd November 2012
View Replies!

Session property

This might be more of a C# question but i am wondering about the Session property that you've access to in the controller of ASP.NET MVC2. What i wanna do is essentially save my "SecretNumber" Class in a session, so i don't have to initilize a new class between posts. Controller basic code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Labb1.Models; namespace Labb1.Controllers { public class homeController : Controller { // // GET: /home/ public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(SecretNumber model) { //Session.Add(\t) Or how do i utilize it. model.Initialize(); model.Count = 6; if (ModelState.IsValid) { model.CheckGuess(); return View("SecretNumber", model); } else { return View("Index"); } } } }
VIEWS ON THIS POST

134

Posted on:

Friday 23rd November 2012
View Replies!

Refresh Form Data

(Edit - My apologies I have posted this in the wrong catagory It should be in VB.net, my mistake) Hi I posted this question at the end of another topic I started but I think it will be over looked as the origional topic was solved thanks to the help of the dreamincode community You must all be getting sick of my quexstions by now haha I suppose you don't learn if you dont ask. Anyway I have used the delete sql method to delete data from a database, I want to refresh the data in the form after the record has been deleted. Do I have to close the form and then open an new instance of it or is there another way I can refresh the data The help is appreciated thankyou. Here is my delete record code Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim delYesNo As DialogResult Dim sql As String delYesNo = MessageBox.Show("This permanently delete record do you wish to continue", _ "Delete Record", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) If delYesNo = Windows.Forms.DialogResult.Yes Then Try sql = "DELETE FROM qryEngineerFullName WHERE Engineer_ID = " & txtEngineer_ID.Text Dim connect As New ConnectDatabase connect.updateAce("AqualineDB.accdb", sql) MessageBox.Show("Record successfully deleted") 'Refresh form data Catch ex As Exception MsgBox(ex.Message) End Try Else Exit Sub End If End Sub This post has been edited by ClockworkCode: 10 June 2010 - 05:18 AM
VIEWS ON THIS POST

223

Posted on:

Friday 23rd November 2012
View Replies!

Login Form with MS SQL Backend

, i'd like to know how to create a login form in c++ .net , checking data against two sql fields (user and pass).
VIEWS ON THIS POST

125

Posted on:

Friday 23rd November 2012
View Replies!

Attributes.Add Problem.

So I have a gridview object and it contains a linkbutton. Right now by default it has the attribute ClientConfirmText='' However I need to add Some text on special occasions so basically Changing it to ClientConfirmText='' So My initial thought was why not cycle through the gridview object and grab the pretty button and use the attributes.add() method (well remove it then re add it) So far I have been able to obtain the button, change its text perfectly fine. I have this code right now button.Attributes.Remove("ClientConfirmText"); button.Attributes.Add("ClientConfirmText",""); And this is the corresponding html inspected element. clientconfirmtext="" Which does not work at all. I am thinking its either because it produces the clienconfirmtext in lowercase instead of camelcase how I had it and/or the face that its unable to be put into single quotes. Anyone know how to use the attributes.Add to surround text in single quotes In c# if I put single quotes it gives me an error about being a string literal.
VIEWS ON THIS POST

117

Posted on:

Friday 23rd November 2012
View Replies!

Printing in ASP.NET

Dear I am developing a website and I want to print parts of the web page, any ideas I don't want to use window.print() method because I want more flexibility in the printing process; such as printing only parts of the page, singing the printed papers with datetime, etc..
VIEWS ON THIS POST

97

Posted on:

Saturday 24th November 2012
View Replies!

Using C# and ASP.NET together

. I'm creating a website using ASP.NET(C#) and have come across a small problem that I cannot seem to figure out. I was to start the back-end coding on my website using C# but when I do it doesnt seem to have access to the same variables and such as the asp.net page. Here is what I'm having a prob with specifically: I put a label on my login page that simply says "Please sign in". Now, I'm trying to write the backend code in C# that will simply change the label's text to "hi" when the submit button is pressed(obiously this is just for testing purposes), but when I go to the Default.aspx.cs page and try and write the code for the butten_click_event, it says it does not recognize the variable that holds the label's name. For example: the label's name is submit_lbl, but when I type submit_lbl.Text = "hi"; in the C# part, it says it doesnt know what submit_lbl is =( Also, I dont know if this is related, but when I went to code for the event of a click(by double clicking on the submit button), it didnt automatically take me to the default.aspx.cs page and generate a new function for me... I had to do it myself.. is this also part of the problem here is my code: Default.aspx: Welcome! Username: Password:   Not connected Register here. And here is the short code for Default.aspx.cs: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Windows.Forms; namespace WebRole1 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void submit_btn_Click(object sender, EventArgs e) { status_lbl.Text = "hi"; //
VIEWS ON THIS POST

180

Posted on:

Saturday 24th November 2012
View Replies!

Which version of datadynamics should be used for asp.net1.1

Can u tell me which version of DataDynamics should i use for asp.net1.1.CAn u also send me the related site to download it...Very very urgent..Thanx in advance..
VIEWS ON THIS POST

192

Posted on:

Sunday 25th November 2012
View Replies!

List Services installed on pc.

Hi all,Is it possible to get a list of all the services on a machine and dump it in a gridview The gridview should have 3 coloumns....1: The Name of the service2: The Status of the Service3: 3 buttons to start / stop, pause / continue, and restartHow would I achieve this
VIEWS ON THIS POST

202

Posted on:

Sunday 25th November 2012
View Replies!

Evaluate values in ItemTemplate

I need to evaluate an equation and display the appropriate image based ont he results. I am doing this in the in the.aspx page. I am binding the data to my control. I need to do this:' Just a snippet\t\t\t
VIEWS ON THIS POST

213

Posted on:

Sunday 25th November 2012
View Replies!

SQL Command to transverse multiple tables

I'm having to work with an existing database to create my current project. I'm needing to traverse multiple tables to output data to an XML file. The database structure is below. I will mark the PK and FK when applicable. I just don't know how to write a complex MS SQL SELECT statement. tbl_People People_ID PK, FKName_TitleName_FirstName_MiddleName_LastName_Suffix tbl_Position Positin_ID PKPeople_ID FKlocation_id FKdept_idroom tbl_locations Location_id PKname tbl_phone phone_id PKpostion_id FKnumber
VIEWS ON THIS POST

144

Posted on:

Sunday 25th November 2012
View Replies!

Display/capture loginname value in textbox

Hi. I have a code here where the loginname will display the computer name. I have another textbox,where i want the same loginname value to be displayed in the textbox. Any ideas on how to do this, Here's my code : Untitled Page welcome //THIS LOGIN NAME TO BE DISPLAYED IN TEXTBOX 2 BELOW ApplicationName: LoweredApplicationName: ApplicationName: LoweredApplicationName: ApplicationName: LoweredApplicationName: //DISPLAY LOGINNAME VALUE ABOVE INTO THIS TEXTBOX please login
VIEWS ON THIS POST

217

Posted on:

Sunday 25th November 2012
View Replies!

Word to Crystal Report

I am developing web application in which an admin uploads Q & A word(.docx) or .pdf files on sever. Now I have to insert date & time when a client download that file. So please help me to get around this problem.
VIEWS ON THIS POST

133

Posted on:

Tuesday 27th November 2012
View Replies!

Can't Recompile My Website

I'm a first time hoster (seekdotnet), so I apologize for the novice question. When I'm working on my local computer, everything is fine, but I'm just having a problem on the hosting server.\tI use FileZilla to edit my website. When I edit the main page (.aspx), the system automatically recompiles the changes and everything works fine. However, when I make changes to the CodeBehind page (.aspx.vb), the website doesn't recongize the changes...I've tried making the changes on my local computer, Build Solution, and everything works.\tI then delete the web page off the server and upload the new page... but still no changes...\tI've tried deleting all the files off the sever and uploading everything again, but then I run into a problem where the website is looking for files off the localhost, instead of the server... I had to pay someone $150 originally because I couldn't figure out why the website kept looking for localhost instead of the server.\tI'm hoping I can learn the cause of this instead of hiring someone again.\tI just need to know the easiest way to recompile the changes I make to the codebehind page.\tDo i need to recompile/reupload the whole site just the one page that I made changes to\tis it something in the global.asax/assembly/web.config that i need to recompile\tThank you so much to all who answers!!!\t
VIEWS ON THIS POST

161

Posted on:

Tuesday 27th November 2012
View Replies!

How to work with two tables - your input is greatly appreciated

hi,I'm new to asp.net development. I have two tables that carry the same primary key. Here's what I want to do: 1. iterate through the main table first, then inside that loop, I want to check my other table for the same key. 2. If it's the same key, I concatenate values of a parricular column in the second table until the key changes. I then want to add this field of concatanated data into my first table. The reason why I am doing this is I need to have the data in one row for a data grid. Does that seem like a normal thing to do in asp.net If I create a data relation between these two tables, how would I use it in such a case\tI am not sure how to implement it.
VIEWS ON THIS POST

189

Posted on:

Tuesday 27th November 2012
View Replies!

Download window opening twice on Export event

I've searched virtually every possible place I can to find an answer.\tI have come up empty.\tI am using the typical code to export a datagrid to Excel.\tHowever, when the "File Download" dialog re-appears if clicking the Open button.\tWhat am I missing\tIf I remove the Response.Addheader line, everything works as expected.\tI would prefer to either force a filename or leave it workbook unnamed with a status of unsaved.\tMy code follows:CODE\t\tPrivate Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click\t\t\t\tDim s, f, g, h, w, o, pSql, pFarm, pAppName As String\t\t\t\ts = lbSql.Items.Item(0).Value\t\t\t\tf = lbSql.Items.Item(1).Value\t\t\t\tw = lbSql.Items.Item(2).Value\t\t\t\tg = lbSql.Items.Item(3).Value\t\t\t\th = lbSql.Items.Item(4).Value\t\t\t\to = lbSql.Items.Item(5).Value\t\t\t\tpSql = s & f & w & g & h & o\t\t\t\tpFarm = farmselect()\t\t\t\tpAppName = dd_AppName.SelectedItem.ToString\t\t\t\tClearControls(dgResults)\t\t\t\tResponse.Clear()\t\t\t\tResponse.AppendHeader("content-disposition", "attachment;filename=" & pAppName.ToString & ".xls")\t\t\t\tResponse.ContentType = "application/vnd.ms-excel"\t\t\t\tResponse.Charset = ""\t\t\t\tEnableViewState = False\t\t\t\tDim stringWrite As New System.IO.StringWriter()\t\t\t\tDim htmlWrite As New HtmlTextWriter(stringWrite)\t\t\t\tdgResults.owCustomPaging = False\t\t\t\tdgResults.owPaging = False\t\t\t\tdgResults.owSorting = False\t\t\t\texp_Status = False\t\t\t\tBind_dgResults(pSql)\t\t\t\tdgResults.RenderControl(htmlWrite)\t\t\t\tResponse.Write(stringWrite.ToString())\t\t\t\tResponse.Flush()\t\t\t\tResponse.End()\t\tEnd SubIf anyone requires additional info, please let me know.
VIEWS ON THIS POST

245

Posted on:

Tuesday 27th November 2012
View Replies!

maniplate underlaying data of a sqldatasource

is there a way to edit/insert the underlaying dataset/dataview of a SQLDataSource after it is bound but before a gridview binds on it
VIEWS ON THIS POST

146

Posted on:

Tuesday 27th November 2012
View Replies!

How to get session id from cs class file in asp.net

I am classing common function in c# class file in asp.net. HttpContext.Current.Session.SessionID gives object reference not set to an instance error. However I could get session id from codebehind filePlease help.
VIEWS ON THIS POST

300

Posted on:

Tuesday 27th November 2012
View Replies!

Dynamic Header - User Control

I am trying to dynamically "insert" a header.ascx file into all of my .aspx files. My header.ascx looks something like this:CODE\t\t\t\t\t\tMy Title\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\tI then have a Page.cs file which is a base class I created using instructions I found on the web:CODEusing System;using System.Web.UI;namespace myNamespace{\t\tpublic class Page : System.Web.UI.Page\t\t{\t\t\t\tprotected override void OnInit(EventArgs e)\t\t\t\t{\t\t\t\t\t\tbase.OnInit(e);\t\t\t\t\t\tControls.AddAt(0, LoadControl("header.ascx"));\t\t\t\t}\t\t}}Finally, my test.aspx page has the following code:CODE..... some HTML here .......Logically, this should work the way it is written. Unfortunately, I am new to ASP.NET so I don't know what I'm doing wrong. I get the error "Unexpected end of file looking for tag" in header.ascx. What seems to be happening is that it is trying to compile header.ascx before including it in my test.aspx. Since test.aspx has the closing tags for form, body, and HTML, it is not working.Does anyone know what I can do to make this work Eventually, I will have a footer file that will have all of the closing tags.. I assume that I can insert this into all of the pages by adding the following line to my Page class:CODEControls.AddAt(1, LoadControl("footer.ascx"));I am not sure if the integer 1 works there or if I need to do it another way. Please put forth your thoughts and comments. Thank you.Varol
VIEWS ON THIS POST

146

Posted on:

Tuesday 27th November 2012
View Replies!

sql strings and filling the dataset

Hallo,I'm trying to get some data from an access table. Everything works fine, but if I add a field (mes_title) to my sql string then I get this message:"You tried to execute a query that does not include the specified expression 'mes_title' as part of an aggregate function"I really don't understand: the field exists in the table, and I can get all the other fields but this one not... where is the mistakethe code I use is this:CODEsub Page_Load(obj as object, e as eventargs)'imposta la connessionedim myConnection as new OleDBConnection ("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\inetpub\wwwroot\new1\blog.mdb")'apri la connessionedim SQLmessages as string'funziona\t\t\t\tSQLmessages = "SELECT tbl_messages.mes_ID, tbl_messages.mes_text, tbl_messages.mes_title, tbl_messages.mes_date, Count(tbl_comments.com_text) AS Count_comments, tbl_languages.lan_language" & _\t\t\t\t\t\t\t\t\t\t\t" FROM tbl_languages INNER JOIN (tbl_messages LEFT JOIN tbl_comments ON tbl_messages.mes_ID=tbl_comments.com_messageID) ON tbl_languages.lan_ID=tbl_messages.mes_languageID" & _\t\t\t\t\t\t\t\t\t\t\t" GROUP BY tbl_messages.mes_ID, tbl_messages.mes_text, tbl_messages.mes_date, tbl_languages.lan_language ORDER BY tbl_messages.mes_date DESC;"dim myCommand as new OleDbDataAdapter (SQLmessages, myConnection)'riempi l'oggetto datasetdim ds as DataSet = new DataSet()\t\t\t\tmyCommand.Fill(ds, "tbl_messages")\t\t\t\t'Segli il tipo di visualizzazione e associalo al controllo del serverDataList1.DataSource = ds.Tables("tbl_messages").DefaultViewDataBind()end sub
VIEWS ON THIS POST

218

Posted on:

Tuesday 27th November 2012
View Replies!

pass multiple parameter to where clause

I have a stored procedure:@product ID integer"SELECT * FROM testtbl WHERE itemID = @productIDASP page with datagrid of product listing with checkbox column and submit button.\tUsers check interested items, click submit, and redirects to detail page with product ID as URL parameter.\tThe detail page should rund the stored procedure WHERE itemID = URL parameter.\tNot to sure on the syntax of passing WHERE parameters.\tIt works fine if there is only one parameter.\tBut not when users have selected multiple items (test.aspxproductID=1&productID=3&productID=8).I have a function "parse()"that parses the above example to "1 or productID = 3 or productID = 8".\tThis caused error because @productID as Integer and parse() is string.\tSo I've changed @productID as nvarchar.\tBut then it only displays itemid=1, Everything after the first digit is ignored.\tI've also changed the stored procedure:@productID as nvarcharSELECT * FROM test WHERE itemID IN (@productID)Changed parse() function to return format as (1,3,8).\tBut this still only returns result with itemid=1I'm using Dreamweaver where:CommandText='dbo.storeproc'parameter =@producID value='Can someone tell me how to get this to work, or is there another way of doing this\t
VIEWS ON THIS POST

206

Posted on:

Tuesday 27th November 2012
View Replies!

Refreshing Grid with Text boxes

I am having problems refreshing a datagrid with textboxes in it. I have created Bound cloumns and converted them into template columns to adjust the sizes of each textbox. why is it that i cannot refresh the grid unless I select auto generate columns \t if I select this option I can refresh the grid no problem. Any help would be appreciatedI have searched the forum and and everything relates to connection or post back problems.
VIEWS ON THIS POST

125

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

179

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

216

Posted on:

Wednesday 28th November 2012
View Replies!

Forms Authentication

I have the following stored procedure to authenticate users on my website:CODEUSE [keystrategy]GO/****** Object:\tStoredProcedure [dbo].[DBAuthenticate]\t\tScript Date: 03/01/2012 11:46:49 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE PROCEDURE [dbo].[DBAuthenticate](@Username nvarchar(50),@Password nvarchar (10))ASDECLARE @ID INTDECLARE @ActualPassword nvarchar(10)SELECT@ID = IdentityCol,@ActualPassword = PasswordFROM dbo.BabysittersWHERE EmailAddress = @UsernameIF @ID IS NOT NULLIF @Password = @ActualPasswordRETURN @ID\t\tELSERETURN - 2\t\tELSERETURN - 1This authenticates against the babysitters table. However, I have parents who can login as well and their details are stored in a different table. Can i authenticate against two tables. So it checks the first table, then the second.This is my code for the login button:CODEProtected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click\t\t\t\tIf IsValid Then\t\t\t\t\t\tIf DBAuthenticate(txtUsername.Text, txtPassword.Text) > 0 Then\t\t\t\t\t\t\t\tFormsAuthentication.RedirectFromLoginPage(txtUsername.Text, False)\t\t\t\t\t\t\t\tSession("User") = txtUsername.Text\t\t\t\t\t\t\t\tResponse.Redirect("secure/home.aspx")\t\t\t\t\t\tEnd If\t\t\t\tEnd If\t\tEnd Sub\t\tFunction DBAuthenticate(ByVal strUsername As String, ByVal strPassword As String) As Integer\t\t\t\tDim conUsers As SqlConnection\t\t\t\tDim strConnection As String\t\t\t\tDim cmdSelect As SqlCommand\t\t\t\tDim parmReturnValue As SqlParameter\t\t\t\tDim intResult As Integer\t\t\t\tstrConnection = ConfigurationManager.ConnectionStrings("KeyStrategyConnectionString").ConnectionString\t\t\t\tconUsers = New SqlConnection(strConnection)\t\t\t\tcmdSelect = New SqlCommand("DBAuthenticate", conUsers)\t\t\t\tcmdSelect.CommandType = CommandType.StoredProcedure\t\t\t\tparmReturnValue = cmdSelect.Parameters.Add("RETURN_VALUE", SqlDbType.Int)\t\t\t\tparmReturnValue.Direction = ParameterDirection.ReturnValue\t\t\t\tcmdSelect.Parameters.AddWithValue("@username", strUsername)\t\t\t\tcmdSelect.Parameters.AddWithValue("@password", strPassword)\t\t\t\tconUsers.Open()\t\t\t\tcmdSelect.ExecuteNonQuery()\t\t\t\tintResult = cmdSelect.Parameters("RETURN_VALUE").Value\t\t\t\tconUsers.Close()\t\t\t\tIf intResult < 0 Then\t\t\t\t\t\tIf intResult = -1 Then\t\t\t\t\t\t\t\tlblMessage.Text = "Username not found!"\t\t\t\t\t\tElse\t\t\t\t\t\t\t\tlblMessage.Text = "Invalid Password!"\t\t\t\t\t\tEnd If\t\t\t\tEnd If\t\t\t\tReturn intResult\t\tEnd Function
VIEWS ON THIS POST

227

Posted on:

Friday 28th December 2012
View Replies!

IE Tabbed pages and Session objects

,Is there a way to capture the "sessions" in IE when the user is using tabs\tI have the following code:CODESub Session_Start(ByVal sender As Object, ByVal e As EventArgs)\tApplication("SessCount") = Application("SessCount") + 1\tResponse.Write("Number of Sessions: " & Application("SessCount") & "")End SubWhen I open the browser the the URL, it displays the number of sessions.\tBut if I open a new tab, it displays nothing.Is there a way to capture the new session when the user opens the new tab
VIEWS ON THIS POST

233

Posted on:

Friday 28th December 2012
View Replies!

ASP.NET 2.0.50727.0*** EVENT ID 1315 ****Event Code 4005**Auth Fails

I am getting these errors all the time on our windows 2003 r2 server... and even thoe there informational they present a pop up box for the end user asking them to log back in. We recently had to rebuild our web server and since we did it wont go away also we renamed it. Any ideas \t\t i have done everything from security on folders ... IIS app pools (the old server was IIS 5.0) new one is (IIS 6.0)... change cookie expiration times etc..******Server Event id Below ---Windows Server (2003)******Event code: 4005 Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired. Event time: 10/03/2008 12:34:28 PM Event time (UTC): 10/03/2008 1:34:28 AM Event ID: 4ce302731b964b7aa614cc487d264b67 Event sequence: 1937 Event occurrence: 49 Event detail code: 50202 Application information: \t\tApplication domain: /LM/W3SVC/599050834/ROOT/STPORTAL-1-128495802221509867 \t\tTrust level: Full \t\tApplication Virtual Path: /STPORTAL \t\tApplication Path: E:\aspnet\StPortal\ \t\tMachine name: REDBACK Process information: \t\tProcess ID: 7000 \t\tProcess name: w3wp.exe \t\tAccount name: NT AUTHORITY\SYSTEM Request information: \t\tRequest URL: http://intranet.mywebsite.com/stportal/default.aspx \t\tRequest path: /stportal/default.aspx \t\tUser host address: 172.16.30.146 \t\tUser:\t\t\tIs authenticated: False \t\tAuthentication Type:\t\t\tThread account name: NT AUTHORITY\SYSTEM Name to authenticate:\tCustom event details: For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.**********Client Error APP log (Windows Xp)******The kerberos client received a KRB_AP_ERR_MODIFIED error from the server $. This indicates that the password used to encrypt the kerberos service ticket is different than that on the target server. Commonly, this is due to identically named\tmachine accounts in the target realm (), and the client realm. Please contact your system administratorCan any body help!!!!!!!!!!!!
VIEWS ON THIS POST

248

Posted on:

Friday 28th December 2012
View Replies!

nested datalist control problem

I have a nested Gridview within a Datalist. The Datalist consists of a linklist button for a membership number and the nested gridview display detail record of that member.The problem is when i click on a linklist button all the gridviews within the datalist display the same record; not the one that refer to each datalist row.Does anyone have the same problem and have any suggestions
VIEWS ON THIS POST

265

Posted on:

Tuesday 1st January 2013
View Replies!

Foreach Page.Controls vs Javascript

I have a search form - which allows users to save their search criteria.\tIf they select one of the saved choices, it will read a database table which contains the name of the page element and the value(s) which go into that element.\tTo complicate this scenario, some of the the elements of combo boxes which allow multiple selections.\tI can't figure out the best way to do this - especially with the combo boxes.\tCan I loop through my dataset and have an inner loop which loops through the page controls to find the right one - and make the assignment in the code behind\t\tOr must I look through the dataset and generate dynamic javascript to populate the elements.\tMy boss said no response.write should be used (is this realistic)\tso the first solution is the best. However I have been unable to example my list of controls. Page.Controls.Count = 3\twhereas I have over 20 server side controls.\tWhen I look at the id 2 of them are null and one is the form element.\tSo I am not understanding how the Page.Controls collection is set up. \t\tI need to get this resolved soon.\tMy whole project is due in 3 weeks and this is holding up the rest of the work.\t
VIEWS ON THIS POST

195

Posted on:

Tuesday 1st January 2013
View Replies!

Custom Config file Reset

I have created a custom config file for my application to modify some global variables.\tIt works fine, but when I modify the config file, it does not update right away.\tI have to reboot the server for the application to use the new file.\tHow can I have the application use the updated file without having to reboot the server.
VIEWS ON THIS POST

436

Posted on:

Tuesday 1st January 2013
View Replies!

problem with application deployment

Guys, I have a weird problem here.\tI'm trying to deploy my Web application to another development server.\tI created an installer via Web Setup in .Net, and it installed successfully.\tHowever, it won't update the datagrid.\tThe ItemDataBound function is working, but if the user clicks the update or cancel buttons, nothing happens; the page just refreshes.\tIt works fine on the server it was built on.\tAny idea what's going on here
VIEWS ON THIS POST

216

Posted on:

Tuesday 1st January 2013
View Replies!

User.Identity.Name within a module?

Is there a way to put User.Identity.Name within a Module\twhen I've tried it, VS.Net tells me that Name is:"Reference to a non-shared member requires an object refernce"How would I go about making this work\t\tor should i be using some thing other then a module
VIEWS ON THIS POST

142

Posted on:

Tuesday 1st January 2013
View Replies!

update row in datagrid

Can somebody please tell me what I have wrong here:CODE\t\t\t\tprivate void KPC_Data_Grid_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)\t\t\t\t{\t\t\t\t\t\tsqlDataAdapter1.SelectCommand.Connection.Open();\t\t\t\t\t\tsqlDataAdapter1.SelectCommand.CommandText = "SELECT name,description,lsl,usl,units FROM KPC where OPID ='" + myOPID + "'";\t\t\t\t\t\t\t\tsqlDataAdapter1.SelectCommand.ExecuteReader();\t\t\t\t\t\tsqlDataAdapter1.SelectCommand.Connection.Close();\t\t\t\t\t\tsqlDataAdapter1.Fill(kpC_Data_Set1, "KPC");\t\t\t\t\t\tsqlDataAdapter1.SelectCommand.Connection.Open();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTextBox name, desc, lsl, usl, unit;\t\t\t\t\t\tname = (TextBox)e.Item.Cells[2].Controls[0];\t\t\t\t\t\tdesc = (TextBox)e.Item.Cells[3].Controls[0];\t\t\t\t\t\tlsl = (TextBox)e.Item.Cells[4].Controls[0];\t\t\t\t\t\tusl = (TextBox)e.Item.Cells[5].Controls[0];\t\t\t\t\t\tunit = (TextBox)e.Item.Cells[6].Controls[0];\t\t\t\t\t\tKPC_Data_Set.KPCDataTable myNewTable = kpC_Data_Set1.KPC;\t\t\t\t\t\tKPC_Data_Set.KPCRow rowToUpdate = (KPC_Data_Set.KPCRow)myNewTable.Rows[e.Item.ItemIndex];\t\t\t\t\t\trowToUpdate.name =\tname.Text;\t\t\t\t\t\trowToUpdate.description = desc.Text;\t\t\t\t\t\trowToUpdate.lsl = Convert.ToInt32(lsl.Text);\t\t\t\t\t\trowToUpdate.usl = Convert.ToInt32(usl.Text);\t\t\t\t\t\trowToUpdate.units =\tunit.Text;\t\t\t\t\t\tsqlDataAdapter1.SelectCommand.Connection.Close();\t\t\t\t\t\tKPC_Data_Grid.DataSource = kpC_Data_Set1.KPC.DefaultView;\t\t\t\t\t\tKPC_Data_Grid.EditItemIndex=-1;\t\t\t\t\t\tKPC_Data_Grid.DataBind();\t\t\t\t\t\tsqlDataAdapter1.Update(kpC_Data_Set1);\t\t\t\t\t\tBindGrid();\t\t\t\t}the error is:Update requires a valid UpdateCommand when passed DataRow collection with modified rows. KPC_Data_Grid.DataBind();\t\t\t\tsqlDataAdapter1.Update(kpC_Data_Set1);\t\t\t\tBindGrid();This is really getting to me...can someone shed some light on this for me\t
VIEWS ON THIS POST

229

Posted on:

Tuesday 1st January 2013
View Replies!

comparevalidator

I created a form with two textboxes and a button. The purpose of the first textbox is to collect a password and the purpose of the second textbox is to confirm the password. Now, I created on each textbox a requiredfieldvalidator. On top of that I created a comparevalidator. My question is the following. When is the comparevalidator (and requiredfieldvalidator) checking executed Because after I type a password in the first textfield and press "tab" to go to the\tsecond textfield, I receive allready the comparevalidator error. I would like firstly, to give the chance to the user to enter both fields, and I would like the comparevalidator\tchecking to appear only after the user pressed on the form button, otherwise it has no sense. How do I do thisI added the code beneath:Enter a Password:** Please Enter a PasswordConfirm Password:** Please Confirm Your Password** Your Password and Confirmation Don't Match
VIEWS ON THIS POST

145

Posted on:

Tuesday 1st January 2013
View Replies!

Controls on WebUserControls

Newbie here so feel free to laugh ...I created a webusercontrol based on a GridView, so I now have a 'myGridView' WebUserControl.Go to a new webform, add the control, and voila .. I now have my modified GV.But ... no smarttag option to set datasource or autoformat etc.There is an option to 'Edit User Control' but that changes the source file .. and to be honest that scared me, is it possible to block that option I don't want my source file being altered by error !So have I missed something realy obvious, or am\tjust barking up the wrong tree altogether Can I create a WUC giving all the normal functionality of a GridView, that can be used multiple times within a page as seperate instances with seperate datasources Many
VIEWS ON THIS POST

155

Posted on:

Tuesday 1st January 2013
View Replies!

TreeView - Selecting wrong node

I have a treeview that has been created with parent and child nodes. I am needing to pass the value of the node that is selected.\tThe problem is when I select on the node, it automatically changes the selection to the first child node. I sat the properties to where the selected node background and font changes to make sure that I wasn't just passing the wrong value.\tAnd it does select the first child node instead of the node that was selected.Any ideas\t
VIEWS ON THIS POST

211

Posted on:

Wednesday 2nd January 2013
View Replies!

problem with variable?

Hi:)My code is very simple,it's one class with some "public void" methods. I'm using 3 "int" variables in that methods.\tProblem is that value of variables is not transfering from one to another method.For example:public class Alabala{int x;public void ButtonClick(){int x=4:}public void ButtonClick2(){x=x+1}message.Text = "x =" + x;}Output is: x = 0That is problem, I cant use my variable!! I want to haveoutput like this x=5.I thinlk I was clear:)
VIEWS ON THIS POST

144

Posted on:

Wednesday 2nd January 2013
View Replies!

Refresh Report

On one webform, I have a CR Viewer AND a drop down select box.The selected value of the drop down will determine the paramater sent to my report.I would like to make this work on one page without having a seperate page for the viewer.I have my Select Box set to Auto Post Back and that works fine. Problem is -- it does not refresh the report in the viewer when I change the value in the select box.I have tried the code that initializes the report in the Selection Change and Page Load Events -- Same result in both
VIEWS ON THIS POST

170

Posted on:

Wednesday 2nd January 2013
View Replies!

client validation of Radio buton list

I want to know if there is a way to validate the radio button list on the client side, without having the user push a button for validation.What I have is two radio button lists. If a user makes a choice in list A, I don't want them to be able to make the same choice in list B. The validators require some sort of button click. I also want to avoid a round trip to the server to validate the control
VIEWS ON THIS POST

48

Posted on:

Wednesday 2nd January 2013
View Replies!

Regular Expressions Find Whole word

I am trying to use regular expressions to find colours in a string but red is causing a problem because it is part of other words. My code is:CODERegex RegExp = new Regex("[^a-z](" + colour + ")[^a-z]|(" + colour + ")$",RegexOptions.IgnoreCase);Match MyRegMatch=RegExp.Match(strIn);if(MyRegMatch.Success){Response.Write("Found: "+MyRegMatch + "");}but where strIn = "quartered" it still finds the colour "red" and i don't want it to. How can I stop this happening and only find a match if it's the word red on it's own i love chocolate
VIEWS ON THIS POST

160

Posted on:

Wednesday 2nd January 2013
View Replies!

use HyperLinkColumn to link to an email address

HiI have a datagrid that display contact info.\tOne of the fields is an email address.\tI want to make that column in the datagrid linked to an .\tWhen i use the HyperLinkColumn type column, it tries to link it to as a page on my site, that is not what I want.\tAny ides on how to do what I want it to do
VIEWS ON THIS POST

146

Posted on:

Wednesday 2nd January 2013
View Replies!

How to call Javascript Function from Textbox Change

How do I call javascript function called "messageuser" from the change event of a text box in ASP.Net
VIEWS ON THIS POST

68

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

175

Posted on:

Wednesday 2nd January 2013
View Replies!

Should my Rollovers be client-side

Hi all,this is going to sound like a silly question but i thought i would ask it!I have a page that has a navigation bar at the top, at the moment it is static and i think for the mean time it will stay that way, so instead of using web control images i am just placing the images in.\tI am using dreamweaver so just placed roll-over images in and created them!I guess i have answered my own question here, however i will continue this post, as i am 3 months in with .Net so i dont fully understand the CLientSide/Server Side integration, all seems a bit alien to me, even though i was a JavaScript wiz when i coded in ASP
VIEWS ON THIS POST

165

Posted on:

Wednesday 2nd January 2013
View Replies!

Validate DateTime HourMinute

\d{2}/\d{2}/\d{2,4} \d{2}:d{2} checks that the date entered in a textbox is in format mm/dd/yy hh:mm or mm/dd/yyyy hh:mmHow can I check for:Months between 1-12Days between 1-31Hours between 0-23Minutes between 0-5
VIEWS ON THIS POST

50

Posted on:

Wednesday 2nd January 2013
View Replies!

Controlling an Image's URL with Java from a DataGrid

I am trying to get an image on a page to change when someone clicks on a datagrid hyperlink column.\tThe idea is change an image src (URL) on the page when this happens.\tI can get the grid to format properly but not quite sure how the "javascript:golink(1) type code works and how to get this click event on the grid to automatically change the IMG tag URL.\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\tSample Date
VIEWS ON THIS POST

67

Posted on:

Wednesday 2nd January 2013
View Replies!