URGENT :: How to get form variable's value in javascript function ?


Hi ,
\tI want to use javascript for some simple client side validations, like if there are 2 textboexes, and if I write in second textbox, & first textbox is null , I want to give alert that first textbox value is null and the focus should be transfered to first textbox.
\tFor this I need to know how to access value of form item in javascript, for which I used to write
\tdocument.form1.textbox1.value
in ASP.
I want equivalent for this statement.
Posted On: Wednesday 2nd of January 2013 02:28:45 AM Total Views:  207
View Complete with Replies

RELATED TOPICS OF ASP.NET PROGRAMMING LANGUAGE




Transfer to Excel Problems

I am transfering data via sql server 2005 from a stored procedure to an excel spreadsheet via a link on the page. The problem I am having is when the query pulls a large record, excel says it can not read the file. Is there an easy fix for this.....when I put another where clause on it, and get it down to a smaller set of returned records, it works just fine. Any ideas\t\t\t\t
VIEWS ON THIS POST

82

Posted on:

Friday 16th November 2012
View Replies!

Populate DropDown from database

I've got a DropDown which I populate from a database. When an item is selected I want to redirect to another page with the selected id, but the problem is it passes "1" no matter what was selected. protected void Page_Load(object sender, EventArgs e) { Populate(); } public void Populate() { OleDbConnection con = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source=" + Server.MapPath("connect.mdb")); con.Open(); string strQuery = "SELECT A_ID, Title_eng FROM C_about"; OleDbCommand cmd = new OleDbCommand(strQuery, con); OleDbDataReader reader = cmd.ExecuteReader(); titleSelection.DataSource = reader; titleSelection.DataValueField = "A_ID"; titleSelection.DataTextField = "Title_eng"; titleSelection.DataBind(); con.Close(); con.Dispose(); } protected void titleSelection_SelectedIndexChanged(object sender, EventArgs e) { string A_ID = titleSelection.SelectedValue.ToString(); Response.Redirect("aboutEdit.aspxA_ID=" + A_ID); } this is the view source: Title: WHO WE ARE // I think that is giving the problem WHAT WE DO Permanent Placements Temporary staff Training & Development CV Writing Tips Jobs Titles & Descriptions Looking for Talent Looking for a Job Register
VIEWS ON THIS POST

147

Posted on:

Friday 16th November 2012
View Replies!

Examination system on a website

w.. I would also like to design a website .Where people register then go to a exam page where 10 questions ( randomly comming from the database) 4 options for each question (radio Buttons , Both comming from database) I need to make it in Vs-2008 ASP.net and the Database should be Microsoft -sql server . I have created the login pages with the login control from the toolbox but now i am stuck as how to bring the questions and answers from the database i also want to set up a timmer in that, so that i can calculate the result and save the result in the database The login control create a MDF database. can I use this same database For my question and answers How can i impliment this Could you please help me with this Thank you
VIEWS ON THIS POST

172

Posted on:

Friday 23rd November 2012
View Replies!

Master Page

thankx who ever willing to help but problem solve
VIEWS ON THIS POST

86

Posted on:

Friday 23rd November 2012
View Replies!

WANT TO GET SELECTED NODE FROM TREELIST IN ASP.NET AND c#APPLICATION

Hi i am new in asp.net i was trying to get value of selected node from tree list i hav created the treelist but i dont know how to call C# function on click event of treelist and then call javascript function in C# code. Please help as i am working first time in asp.net puneet
VIEWS ON THIS POST

69

Posted on:

Saturday 24th November 2012
View Replies!

Problem with retrieving data from my database

Guys I have a problem with my asp website I'm Coding with C# and i face a problem which disappointing me is that : i'm retrieving a data from Column info form my database but the column contains a very large data and i want to customize this data by adding new line the the data and changing the color of some data the data that i retrieving it appears in this form Highly qualified and experienced medical staff (from German and Austria for 10 years ) after post graduation doctor degree and highly equipped medical service in the following pediatric subspecialties: \n1- Neonatology and Neonatal Intensive Care Unit: NICU 2- Pediatric intensive care unit: PICU 3- Intermediate or Transitional intensive care unit: TICU 4- Pediatric cardiology. 5- Pediatric Respiratory diseases. 6- Pediatric endocrinology. 7- Pediatric oncology. 8- Pediatric hematology. 9- Pediatric metabolic diseases 10- Pediatric Gastroenterology and Hepatology. 11- Pediatric Haematology. 12- Pediatric Nephrology. 13- Pediatric Urology. 14- Pediatric Dermatology. 15- Pediatric ENT. 16- Pediatric Infectious and Tropical Diseases. 17- Genetics and Congenital Anomalies. 18- Growth and Development. 19- Pediatric ergic Diseases. 20- Pediatric Immunological Diseases. 21- Pediatric Psychiatry. 22- Pre and Post operative care in: Pediatric surgery, Pediatric Transplantation, Orthopaedics, Neurosurgeries. Follow up of pediatrics patients during the first year of life: The infants which will be included in this system will have:- 1- O.P.D visit once per month to consultant clinic. 2- vaccines are free. 3- ER visits at many time are free. 4- Regular follow up of all stages of growth and development of the infant. 5- Giving all instructions to parents which is important for the infant in period of his life. Pediatric Asthma Clinic: Services in this clinic:- 1- Management of all pediatric patients with chest diseases and bronchial asthma. 2- Management of pulmonary functions of pediatric patients with chronic chest problems. 3- Training of children and parents on using inhaler devices. 4- Doing all investigations for diagnosing and follow up of chest problems in children. 5- Giving regular health education programs for children and parents regarding chest problems and pediatric bronchial asthma. For more information Call: 8406000 Ext: 5121 and i need it to appear in that form : Highly qualified and experienced medical staff (from German and Austria for 10 years ) after post graduation doctor degree and highly equipped medical service in the following pediatric subspecialties: 1- Neonatology and Neonatal Intensive Care Unit: NICU 2- Pediatric intensive care unit: PICU 3- Intermediate or Transitional intensive care unit: TICU 4- Pediatric cardiology. 5- Pediatric Respiratory diseases. 6- Pediatric endocrinology. 7- Pediatric oncology. 8- Pediatric hematology. 9- Pediatric metabolic diseases 10- Pediatric Gastroenterology and Hepatology. 11- Pediatric Haematology. 12- Pediatric Nephrology. 13- Pediatric Urology. 14- Pediatric Dermatology. 15- Pediatric ENT. 16- Pediatric Infectious and Tropical Diseases. 17- Genetics and Congenital Anomalies. 18- Growth and Development. 19- Pediatric ergic Diseases. 20- Pediatric Immunological Diseases. 21- Pediatric Psychiatry. 22- Pre and Post operative care in: Pediatric surgery, Pediatric Transplantation, Orthopaedics, Neurosurgeries. Follow up of pediatrics patients during the first year of life: The infants which will be included in this system will have:- 1- O.P.D visit once per month to consultant clinic. 2- vaccines are free. 3- ER visits at many time are free. 4- Regular follow up of all stages of growth and development of the infant. 5- Giving all instructions to parents which is important for the infant in period of his life. Pediatric Asthma Clinic: Services in this clinic:- 1- Management of all pediatric patients with chest diseases and bronchial asthma. 2- Management of pulmonary functions of pediatric patients with chronic chest problems. 3- Training of children and parents on using inhaler devices. 4- Doing all investigations for diagnosing and follow up of chest problems in children. 5- Giving regular health education programs for children and parents regarding chest problems and pediatric bronchial asthma. For more information Call: 8406000 Ext: 5121 so i need to customize this data to make a new line after the end of the line Important note : I'm using a details list to preview the data
VIEWS ON THIS POST

174

Posted on:

Saturday 24th November 2012
View Replies!

need help with methods

hi, I was wondering how to connect ms access to c# web service. How to retrieve the data inside the database when adding the reference.
VIEWS ON THIS POST

303

Posted on:

Saturday 24th November 2012
View Replies!

order entry page need help with command buttons

i made an order entry page with two ddl's a gridview, a formview and a listview.. ddl1 is bound to the name fieild in the menu table and selects a restrauant which causes that restrauants menu to appear in the gridview ... ddl2 is bound to the phone number field in the customer table which causes the formview to display current customer info with editing and inserting working except inserting new customer or editing phone number does not postback to ddl2(only reloading the page will display the edited or new phone number) the listview is bound to the orderdetail table and displays nothing at this time.... the details view which contains the menu info also has four command fields with commandbuttons for ordering small, med, large and xlarge items. i want to use the command buttons to write that item order to the orderdetail table...each item has pricing for available sizes ... only the command button for the correspondind price field should work(ie. if main menu.small price field is the only field that has a price .. then small price button should be the only button to write an item order to the table if all four fields have prices then all four buttons should work. my hope is that someone could give me some direction on how to make the commandbuttons do their job. heres all my code sofar protected void DetailsView1_ItemInserted(Object sender, System.Web.UI.WebControls.DetailsViewInsertedEventArgs e) { if (e.Exception != null) { ErrorMessageLabel.Text = "An error occured while entering this record. Please verify you have entered data in the correct format."; e.ExceptionHandled = true; } GridView1.DataBind(); } protected void DetailsView1_ItemUpdated(Object sender, System.Web.UI.WebControls.DetailsViewUpdatedEventArgs e) { GridView1.DataBind(); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { DetailsView1.ChangeMode(DetailsViewMode.ReadOnly); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { DetailsView1.ChangeMode(DetailsViewMode.ReadOnly); } protected void GridView1_PageIndexChanged(object sender, EventArgs e) { DetailsView1.ChangeMode(DetailsViewMode.ReadOnly); } protected void GridView1_Sorted(object sender, EventArgs e) { DetailsView1.ChangeMode(DetailsViewMode.ReadOnly); } protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e) { if (e.Exception != null) { ErrorMessageLabel.Text = "Failed to DELETE due to foreign key contstraint on the table. You may only delete rows which have no related records."; e.ExceptionHandled = true; } } protected void DetailsView1_DataBound(object sender, EventArgs e) { if (DetailsView1.CurrentMode == DetailsViewMode.Insert) { TextBox nameTextBox = (TextBox)DetailsView1.Rows[1].Cells[1].Controls[0]; nameTextBox.Text = DropDownList1.SelectedValue; nameTextBox.Enabled = false; } } GridView DetailsView Master-Details (Insert) .style5 { font-size: x-large; color: #FF0000; } MyDelivery Menu Edit Screen Choose a Restaurant: -- Choose a Restraunt -- \t\t\t This post has been edited by johntigner: 07 October 2008 - 04:47 PM
VIEWS ON THIS POST

226

Posted on:

Saturday 24th November 2012
View Replies!

(RESOLVED) Profile Help!

Im having problems w/ the whole Profile thing. Im able to create the provider and add properties for the profile in the web.config file and when a user registers i even set the 2 profile values but i dont understand where they are being saved to. My provider is pointing to a sql server 2000 database yet the aspnet_Profile table is empty although as i browse my pages i am able to access the profile properties. What gives. Here is the webcongigCode:\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\tHere is where i set themCode:Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser\t\t\t\t'Create a Profile Object\t\t\t\tDim p As ProfileCommon = CType(ProfileCommon.Create(CreateUserWizard1.UserName, True), ProfileCommon)\t\t\t\t'Create a VenId Object\t\t\t\tp.VenId = (CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("VenId"), TextBox).Text)\t\t\t\t'Create a EmpId Object\t\t\t\tp.VenId = (CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("EmpId"), TextBox).Text)\t\t\t\t'Save the Profile Information.\t\t\t\tp.Save()\t\tEnd Sub
VIEWS ON THIS POST

143

Posted on:

Sunday 25th November 2012
View Replies!

not working as Server Control

Hi I have the following code:\t\t--- Please Select ---\t\tWhere the getBrands method populates the combo box.Now when I make it a server control (ie runat="server") it doesnt work anymore Why
VIEWS ON THIS POST

214

Posted on:

Sunday 25th November 2012
View Replies!

My SQL code does not allow my items to be saved

Whenever i try to save my code it breaks while getting the info in here is a sample of the area where it actually breaks. does anyone have any idea why this breaks at the
VIEWS ON THIS POST

148

Posted on:

Sunday 25th November 2012
View Replies!

Datas are inserted but not stored in the database

i got an problem in asp.net page in the form we can use more controlse that all the controls are worked well and event's also fired and that the page message also displayed properly but these are the data's are not in the database if you have any tips for me pls send yours reply for me. rpkaran This post has been edited by rpkaran: 24 June 2010 - 03:36 AM
VIEWS ON THIS POST

214

Posted on:

Monday 26th November 2012
View Replies!

Small Problem

Hi... now i m begginer to asp.net ... so the problem is... whenever i press the button1 i wanted it to run Mainapp and show the out put in a label or textbox... can i do it in this way... means when i press button1 it will show me the result of that class whtever it is... there is my code.. thanxxxxxxxxxxxxxxxxxxxxx..... public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { } class MainApp { static void Main() { // Create adapter and place a request University uni = new Teacher(); uni.Show(); // Wait for user Console.ReadKey(); } /// /// Target Class /// /// class University { public virtual void Show() { Console.WriteLine("This will call Show()"); } } /// /// Adapter Class /// class Teacher : University { private Student stu = new Student(); public override void Show() { Console.WriteLine("You are in Teacher's Class Show() \n and now some_request() of Student class will be called \n\n"); stu.some_request(); } } /// /// Adaptee Class ///
VIEWS ON THIS POST

341

Posted on:

Monday 26th November 2012
View Replies!

how to add calendar control in asp.net

vb.net coding: Imports System.Data.OleDb 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 If Not IsPostBack Then ' Generates report for current year lblCalendar.Text = "" Dim horizontalRepeat As Integer = 3 ' number of months in horizontal direction Dim month As Integer For month = 1 To 12 If (month Mod horizontalRepeat = 1) Then lblCalendar.Text += "" End If lblCalendar.Text += "" + generateCalendar(month, 2007) + "" If (month Mod horizontalRepeat = 0) Then lblCalendar.Text += "" End If Next lblCalendar.Text += "" End If End Sub Private Function generateCalendar(ByVal month As Integer, ByVal year As Integer) As String ' generates the calendar as per the booking status Dim wholeCalendar(5, 6) As Integer Dim weeks As Integer = 0 Dim day As String = "" Dim tmpDate As DateTime Dim myDate As Integer For myDate = 1 To 31 Try tmpDate = New DateTime(year, month, myDate) If (day = "Saturday") Then weeks += 1 End If day = tmpDate.DayOfWeek.ToString() If (day = "Sunday") Then 'If (wholeCalendar(weeks, 0) > 0) Then weeks += 1 wholeCalendar(weeks, 0) = myDate ElseIf (day = "Monday") Then 'If (wholeCalendar(weeks, 1) > 0) Then weeks += 1 wholeCalendar(weeks, 1) = myDate ElseIf (day = "Tuesday") Then 'If (wholeCalendar(weeks, 2) > 0) Then weeks += 1 wholeCalendar(weeks, 2) = myDate ElseIf (day = "Wednesday") Then 'If (wholeCalendar(weeks, 3) > 0) Then weeks += 1 wholeCalendar(weeks, 3) = myDate ElseIf (day = "Thursday") Then 'If (wholeCalendar(weeks, 4) > 0) Then weeks += 1 wholeCalendar(weeks, 4) = myDate ElseIf (day = "Friday") Then 'If (wholeCalendar(weeks, 5) > 0) Then weeks += 1 wholeCalendar(weeks, 5) = myDate ElseIf (day = "Saturday") Then 'If (wholeCalendar(weeks, 6) > 0) Then weeks += 1 wholeCalendar(weeks, 6) = myDate End If Catch ex As Exception Exit For End Try Next ' Generates the HTML calendar Dim htmlCalendar As String = "" Dim objEventsDAO As New EventsDAO() Dim dt As DataTable Dim i As Integer, j As Integer htmlCalendar += "" htmlCalendar += "" + getMonthName(month) + " " + year.ToString() + "" htmlCalendar += " Sun Mon Tue Wed Thu Fri Sat " For i = 0 To 5 htmlCalendar += "" For j = 0 To 6 If wholeCalendar(i, j) > 0 Then dt = objEventsDAO.GetEvent(wholeCalendar(i, j), month, year) If (dt.Rows.Count > 0) Then Dim toolTip As String = dt.Rows(0)("Event").ToString() htmlCalendar += "" + wholeCalendar(i, j).ToString() + "" Else htmlCalendar += "" + wholeCalendar(i, j).ToString() + "" End If Else htmlCalendar += " " End If Next htmlCalendar += "" Next htmlCalendar += "" ' Close database connection objEventsDAO.CloseConnection() ' returns the generated HTML calendar Return htmlCalendar End Function Private Function getMonthName(ByVal month As Integer) As String Dim months() As String = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"} Return months(month - 1) End Function End Class
VIEWS ON THIS POST

218

Posted on:

Monday 26th November 2012
View Replies!

VSI error: "object reference not set to an instance of an object&

, all. I'm currently working on creating a distributable project template, so that a few of the other developers I'm working with can quickly get their projects up and running. I have created and exported my template just fine, to a file called ss.zip. I have also created my .vscontent file, which looks like this: ss.zip foo bar VSTemplate 1.0 However, when I package it all up as ss.vsi, upon double-clicking to install I get an error: object reference not set to an instance of an object. Does anyone know what I might be doing wrong
VIEWS ON THIS POST

163

Posted on:

Monday 26th November 2012
View Replies!

Deleting a file from a directory

I am able to view a directory and also upload a file to a directory, I am having trouble deleting a file in the directory Here is my code for the Default.aspx Page Accessing a shared folder protected void Button2_Click(object sender, EventArgs e) { if(FileUpload1.HasFile) try { FileUpload1.SaveAs(@"\\ned-505\c$\CaleroShared\" + FileUpload1.FileName); Label1.Text = "File has been successfully uploaded"; } catch (Exception ex) { Label1.Text = "ERROR: " + ex.Message.ToString(); } else { Label1.Text = "You have not specified a file."; } }         and here is the code in my Default.aspx.cs page using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace NetworkFolderAccess { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button3_Click(object sender, EventArgs e) { string fileName = ""; fileName = Convert.ToString(FileDelete); try { if(File.Exists(fileName)) { File.Delete(fileName); Label2.Text = "File deleted successfully"; } else { throw new FileNotFoundException(); } } catch(FileNotFoundException ex) { Label2.Text += ex.Message; } catch(Exception ex) { Label2.Text += ex.Message; } } } } This post has been edited by TheGame1083: 25 September 2009 - 12:03 PM
VIEWS ON THIS POST

228

Posted on:

Tuesday 27th November 2012
View Replies!

Failed to generate a user instance of SQL Server due to failure in ret

Hi guyz, Im about to give up on this subject and this project. I have created a membership database with user roles and uploaded to the hosting server and i have connectionstring to connect to this database, its been good couple of months trying to login to access admin pages and i have been getting the the above error same. please see my connectionstring:
VIEWS ON THIS POST

188

Posted on:

Tuesday 27th November 2012
View Replies!

Passing % char in the URL

,I send a DB2 query from a main Form to another one within the URL. In the second form the query is associated to a textbox.Here is an example of one part of the query:(Main form)MyString = "WHERE (CDDSGETK NOT LIKE '%AF%' )"Response.Redirect("Query.aspxQ=" & MyString)(Second Form)Query = Request.QueryString("Q")Query = "WHERE (CDDSGETK NOT LIKE '%' )"A part of the query has disappeared !! and in the URL I can see that the string is correct:WHERE%20(CDDSGETK%20NOT%20LIKE%20'%AF%'%20)%20I think the problem come from the %, but can't understand how the application interprets the URL result.Any idea
VIEWS ON THIS POST

216

Posted on:

Tuesday 1st January 2013
View Replies!

automated update of website

A potential client was talking to me about how her web site is updated. She stated the following: "The big companies that I work with (Bla Bla Bla) allow you to download all of their products in either excel or cvs I then take their form and upload it on our site. I'm new to asp.net. I understand how a list of products can be downloaded, but I don't understand how this same list can be uploaded to another ecomerce site. Is it built into a SQL database to create a new .aspx page on the fly with the new images, prices, etc. What is the technical name for this procedure so that I can google this Aslo, what's confusing me is she is doing this herself, not the webmaster so there must be some sort of on-line form that she logs into all built by the webmaster.
VIEWS ON THIS POST

188

Posted on:

Tuesday 1st January 2013
View Replies!

Stripping Table HTML from CreateUserWizard

Is it possible via code to change the way a CreateUserWizard control is rendered I've customised the steps to use some divs etc to layout the content to match my page formating but the control seems to generate some code such as \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\tat the beginning which I would like to strip out for cleaner markup. Steve G (MCSE / MCSA:Messaging)
VIEWS ON THIS POST

134

Posted on:

Tuesday 1st January 2013
View Replies!

Related topics - How?

Hi , can you please give me some ideas/direction as to how I should go about having additional feature to my pages.What I want to have:When a user visits/reads a topic in my site, I want them also to see, say in the right-hand side a box that says something like, "The users who viewed/read this topic also read the following topics".... and then follows a list of the topics in bullets points.Any ideas Thnx for any help
VIEWS ON THIS POST

99

Posted on:

Tuesday 1st January 2013
View Replies!

Slow application after upgrading from 1.1 to 2.0

our web site contians Web Application1 (.net 2.0) = the web stie\t\tWeb Application2 (.net 2.0) = virtual directory\t\tWeb Application3 (classic ASP) = virtual directoryAfter we upgraded our server from .net 1.1 to 2.0 the Web Application2 is very slow (web application1 and web application3 are fast as usual). why- all applications use same connection string to communicate with our database.- we have installed .net 2.0 and Service Pack 1 for it.- I have changed the asp.net under asp.net tab under property of the web site
VIEWS ON THIS POST

592

Posted on:

Tuesday 1st January 2013
View Replies!

Issue with Dynamic Dependent Drop Down Menu

you have c# code, and i normally work with vb.net, but where is your HANDLES after the event functionin vb you havePublic Sub xx_click(sender, e) handles xx.click -Sometimes the answer to your question is the hack that works
VIEWS ON THIS POST

272

Posted on:

Wednesday 2nd January 2013
View Replies!

Why we use this,do any one know?

Hi all, Private designerPlaceholderDeclaration As System.Object
VIEWS ON THIS POST

151

Posted on:

Wednesday 2nd January 2013
View Replies!

Error on Passing Logon Info through aspx

I am trying to pass the logon info through the following so that users can eliminate unnecessary logon processes.\t\t\tWhen I submit this form, I am getting an error "Web Interface 4.2 ERROR: An internal error occurred. Please contact your system administrator."I have used the same format for asp page and it worked perfectly fine.\tFor the format fore asp, the only difference is the URL and the domain as below.\t\tSo, the differences are:https://ABC.DEF.com/Prod/auth/login.aspx\t==> newhttps://www.ABCasp.com/DEF/frameset.asp ==> oldVALUE='ABC.DEF'\t==> newVALUE='ABCASP' ==> oldWhy it works fine with asp, but not with aspxHow do you fix this issuethx much
VIEWS ON THIS POST

243

Posted on:

Wednesday 2nd January 2013
View Replies!

New to .NET - need help getting started

I've been coding w/ asp 3.0 for the last seven years. It's time, finally, for me to move up to .net. However, I know nothing about .net and I don't understand the new interface.Here are my questions:1. How do I create a project in VS.NET 2005 in which to open one of my legacy ASP 3.0 websites so I can maintain the site as is and start adding .net functionality2. Is there a good book or tutorial out there somewhere for an asp developer like myself, with which to get up to speed using VS.NETI've tried just opening my website in VS.net and it takes a very long time just for it to load. So I'm sure I do not have it configured correctly somewhere. Probably on the server. After some trial and a lot of error, I decided to just ask here for some guidance so I can get things moving forward
VIEWS ON THIS POST

162

Posted on:

Wednesday 2nd January 2013
View Replies!

Accessing HTMLInputFile across thread boundry?

Guys,I'm working on a site that the user will upload a file to, a bunch of work will be done to that file, then the user will be given the option to view some data once the work is done.To make it look smooth I do all of the work to the file in a seperate thread, then use an AJAX timer/update panel to update the page on the client side as the work progresses server side.Unfortunately, I ran into a problem when I tried testing it. Running in the VS2005 environment (localhost:port/site/page) it works flawlessly. But when I try to browse to it hosted on IIS5 (localhost/site/image) I get "Cannot access a closed file."Here's a trimmed up copy of the code:CODEProtected Sub page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\tIf Not Me.IsPostBack Then\t\t'initial load stuff here\tElse\t\t'initial submit\t\tIf Not Me.Timer1.Enabled = True Then\t\t\tIf Not fdPresentation.PostedFile Is Nothing And _\t\t\t\tfdPresentation.PostedFile.ContentLength > 0 Then\t\t\t\t\t'display the update panel\t\t\t\t\tMe.up1.Visible = True\t\t\t\t\tDim del As New del_DoWorkInBackground(AddressOf DoWorkInBackground)\t\t\t\t\t'Me.ifPresentation is the HTMLInputFile\t\t\t\t\tdel.BeginInvoke(Me.ifPresentation, Nothing, Nothing)\t\t\t\tElse\t\t\t\t\tResponse.Write("Please select a file to upload.")\t\t\t\tEnd If\t\t\tEnd If\t\tEnd If\tEnd Sub\tPrivate Delegate Sub del_DoWorkInBackground(ByRef ifPresentation As htmlinputfile)\tPrivate Sub DoWorkInBackground(ByRef ifPresentation As htmlinputfile)\t\tDim m_blStatus As New BulletedList\t\tTry\t\t\tMe.Timer1.Enabled = True\t\t\t'...\t\t\tifPresentation.SaveAs(SaveLocation)\t\tcatch exc as exception\t\t\t'error reporting\t\tend try\tend subend classIt appears to be some kind of difference between the VS2k5 host and IIS, but I'm not sure of a way to make IIS behave better. Any thoughts, configuration or code whys-Rick VB.Net Forum forum796\t\tforum855 ASP.NET Forum\t\tI believe in killer coding ninja monkeys.
VIEWS ON THIS POST

327

Posted on:

Wednesday 2nd January 2013
View Replies!

ADODB.Recordset (0x800A0BCD)

Hi , I am getting the fllowing msg. I can load the record to be updated in the update form, when the submit button is hit the record doesnot update and throws the following error. I have had a look through the code can can't see where I am going wrong. any help will be appreciated. ADODB.Recordset (0x800A0BCD)Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.-------------- --------------------------------------
VIEWS ON THIS POST

108

Posted on:

Wednesday 2nd January 2013
View Replies!

javascript for maintaining vertical position in code behind

yes, I know I posted this concerning a recent post, but what was with a control I found on the web.I'm now trying it on my own.Here's what I have in my HTML:*****************************************************************For my code behind, I've got the following in the page_load event:If Page.IsPostBack ThenResponse.Write("location.href="" temp_href=""#"""";")End If...tried this too, and no luck for the page_load event:***********************************************************************If Page.IsPostBack ThenDim strScript As StringstrScript = ""strScript = strScript & "location.href=""#"";"strScript = strScript & ""Page.RegisterStartupScript("ClientScript", strScript)End IfAny suggestions are welcome
VIEWS ON THIS POST

151

Posted on:

Wednesday 2nd January 2013
View Replies!

Trouble connecting to SQL Server

I'm testing an ASP.NET app for the 1st time on the intranet.\tIn the past when running the app locally in my PC it has worked OK.\tWhen I tried it in the intranet I can get it started but when a webform tries to connect to a SQL server I get the following error:[InvalidOperationException: ExecuteReader: Connection property has not been initialized.]c:\inetpub\wwwroot\icr\enternew.aspx.cs:116Here's the code I have:CODEif (!Page.IsPostBack)\t\t\t\t\t\t{\t\t\t\t\t\t\t\tfncGetSQLConn();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconnSQLServer = new SqlConnection(strConnSQL); \t\t\t\t\t\t\t\tconnSQLServer.Open(); \t\t\t\t\t\t\t\tstring strSQL = "SELECT Description FROM ICRSBU";\t\t\t\t\t\t\t\tSqlCommand cmd = new SqlCommand(strSQL, connSQLServer);\t\t\t\t\t\t\t\tdr = cmd.ExecuteReader();\t\t\t\t\t\t\t\tlstSBU.DataSource = dr;\t\t\t\t\t\t\t\tlstSBU.DataBind();\t\t\t\t\t\t\t\tconnSQLServer.Close();}public SqlConnection fncGetSQLConn() \t\t\t\t{ \t\t\t\t\t\tif (connSQLServer == null) \t\t\t\t\t\t{ \t\t\t\t\t\t\t\ttry \t\t\t\t\t\t\t\t{ \t\t\t\t\t\t\t\t\t\tconnSQLServer = new SqlConnection(strConnSQL); \t\t\t\t\t\t\t\t\t\tconnSQLServer.Open(); \t\t\t\t\t\t\t\t\t\treturn connSQLServer; \t\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\tcatch (Exception ex) \t\t\t\t\t\t\t\t{ \t\t\t\t\t\t\t\t\t\tAlertMsg(" Error connecting to ICR database, make sure database is not in use" + ex.ToString()+ "");\t\t\t\t\t\t\t\t\t\tconnSQLServer = null; \t\t\t\t\t\t\t\t\t\treturn connSQLServer; \t\t\t\t\t\t\t\t} \t\t\t\t\t\t} \t\t\t\t\t\telse \t\t\t\t\t\t{ \t\t\t\t\t\t\t\treturn connSQLServer; \t\t\t\t\t\t} \t\t\t\t}At the beginning I declare the following as public:CODEpublic string strConnSQL = "Server=ServerName" + \t\t\t\t\t\t\t\t\t\t";" + "Database=DBName" + ";" + "Integrated Security=SSPI";\t\t\t\tpublic SqlConnection connSQLServer;\t\t\t\tpublic SqlDataReader dr;Not sure why it connects to the SQL server no problem when running the site locally but not when running it via the intranet.
VIEWS ON THIS POST

212

Posted on:

Wednesday 2nd January 2013
View Replies!

Corect place to declare DB connection ?

,I have a general question about the ADO connection object. In my project, I've create a module that's inthe app_code folder and looks something like this:Public Module Database\t\tPublic MyConn As OleDb.OleDbConnection\t\tPublic Sub OPEN_DB()\t\t\t\tTry\t\t\t\t\t\tMyConn = New OleDb.OleDbConnection(ConfigurationManager.AppSettings("ConnectionString"))\t\t\t\t\t\tIf MyConn.State ConnectionState.Open Then MyConn.Open()\t\t\t\tCatch ex As Exception\t\t\t\t\t\tMyConn.Dispose()\t\t\t\t\t\tHttpContext.Current.Response.Write(ex.Message)\t\t\t\t\t\tHttpContext.Current.Response.End()\t\t\t\tEnd Try\t\tEnd Sub End Module Now in my pages I refer to this module when I need to open a new connection. Example: Public Function GetSomething() As String\t\tTry\t\t\t\tCall OPEN_DB()\t\t\t\tDim SQL As String = "SELECT field FROM MySampleTable WHERE ID = 1"\t\t\t\tDim MyCMD As New OleDb.OleDbCommand(SQL, MyConn)\t\t\t\tRES = CType(MyCMD.ExecuteScalar(), String) \t\t\t\tMyCMD.Dispose()\t\tCatch ex As Exception\t\t\t\tCall READ_EXCEPTION(ex)\t\tFinally\t\t\t\tMyConn.Close\t\t\t\tMyConn.Dispouse\t\tEnd Try\t\tReturn RESEnd FunctionThis works great except now I get occasional errors thrown by the application saying that either the connectionis not open, or is initializing or connection's current state is closed etc. This does not happen all the time and simply refreshing the page with the error will get rid of it, which leads meto believe that perhaps the declaration of the MyConn object in the module isn't such a good thing.When the MyConn is declared the way I have it can I cause any problems
VIEWS ON THIS POST

258

Posted on:

Wednesday 2nd January 2013
View Replies!

Problem with the state of a DropDownList

I have got a problem to keep the state of a DropDownList.My page is organized this way:- 1 MasterPage with :\t- 1 DropDownList\t- 1 Menu\t- 1 Content- X pages displayed into the Content when clicking on the menuWhen I am clicking on the menu, the PostBack refresh the DropDownList to the SelectedIndex 0.I want to use the selected value in the ContentPages.I have tried with the ViewState and with cookies with no success (I guess I am using it the wrong way).Many
VIEWS ON THIS POST

195

Posted on:

Wednesday 2nd January 2013
View Replies!

(New to WebForms) Crystal Reports Question

,I'm trying to set up a crystal report viewer in a web form using vb.net/asp.net.\tI'm finding that the following lineCrystalReportViewer1.ReportSource = "C:\\report_1.rpt"followed by CrystalReportViewer1.Refresh()Is failing with...Object reference not set to an instance of an object. etc...Does anyone have any tips on how to setup a simple Crystal Report viewer in a web form.\tI've done this before in Windows Forms and not had trouble
VIEWS ON THIS POST

215

Posted on:

Wednesday 2nd January 2013
View Replies!

Windows Authentication from non-trusted domain request

I'm building a VB.net application which sends an HTTP request to a web form (created in classic ASP) on a remote server. I pass in several form parmeters as if they came from the actual form. The form returns an Excel spreadsheet which I stream into a file. The code works great if the called form is protected via IIS Basic Authentication. However, the form is actually using Windows Authentication in IIS. Hitting the site manually is no problem. I am prompted to enter my name/password, I do, and I go right in. I'm having a real tough time doing this programatically as I am clearly on a different domain than the called server is. I'm assuming this is why I am prompted for name/password when I log in manually to the site. I'm asking this forum because you seem to have the authentication knowledge down.
VIEWS ON THIS POST

211

Posted on:

Wednesday 2nd January 2013
View Replies!

web timer

i am really stuckcan anybody guide me....how timer works in web application useing vb.net
VIEWS ON THIS POST

119

Posted on:

Wednesday 2nd January 2013
View Replies!

Dropdown value and StringBuilder

Does anyone know how I would do this'** When a user selects an option from the dropdown box an onChange event modifies the value of the hidden input box below. sb.Append("")'** I need to change "description" below to be what the user has chosen i.e. The value from the hidden input box descriptionName_ + vid ** instead of ds.Tables(0).Rows(i).Item("description").ToString()This didn't work. document.forms[0].elements['descriptionName_" + vid + "'].valuesb.Append("")
VIEWS ON THIS POST

283

Posted on:

Wednesday 2nd January 2013
View Replies!

repeater

I made a user control in asp.net 2.0 beta 2 that consists of a repeater that has an xmldatasource.\ti have an xpath statement brining back info from an rss feed.\tthis is all working fine, but i would like to only bring back the top 10 results from the rss feed.\tdoes anyone know how to put that limit on the xpath statement
VIEWS ON THIS POST

125

Posted on:

Wednesday 2nd January 2013
View Replies!

Crystal Reports .net Help displaying large amount of data

I have a Crystal Report .Net which displays data from a DS which is then passed on to the SQL server session.When the number of rows in the Dataset is less (eg. 2000) then the report viewer opens correctly. But when the number of records is large (eg. 26000) then the report wont open.I get the message:SERVER APPLICATION UNAVAILABLE (or) UNABLE TO CONNECT TO SQLSERVER SESSION.Please help. I want to know if there is a limitation on the Report Viewer or some settings I need to change in the web.config fileThank You!
VIEWS ON THIS POST

211

Posted on:

Wednesday 2nd January 2013
View Replies!

Refer parent function in custom control???

i want to build a custom control that has a overridable function. This function can be overridden by the implementing page.e.g.:.ascx file has this functionpublic overridable FunctionName() as booleanend functionin .aspx i need to be able to override this function. like so:overrides FunctionName() as booleanresponse.write("Yeah!!!")end functionbut since the aspx file inhertis from page it is unable to override the custom control function.Can this be done\t I am open to other suggestions for implementing the same functionality... Known is handfull, Unknown is worldfull
VIEWS ON THIS POST

231

Posted on:

Wednesday 2nd January 2013
View Replies!

Dynamically Assign IDs to Controls

Okay, I've searched EVERYWHERE for this, and I am still confused.\tSaw a few posts here about it, but again, still confused...I am creating a dynamic HTML table, from a database table.\tIn the database table, I have cell properties for the HTML Table (Rowspan, colspan, color, etc).\tI need to be able to fill in these cells with the information I need.\tI had this running in ASP, but .NET is quite different...I've decided to create the table, and use placeholders in each\tcell.\tThen in the Page_Load event, populate those placeholders with the necessary info.\tNow, in order to keep the ID's straight, I need to dynamically assign ID's when I create the PlaceHolder.\tI am doing it by this..CODE\t\tdim plcHold as PlaceHolder\t\tplcHold = new PlaceHolder()\t\tplcHold.ID = "MainHold" & myReader("templateSpaceVar")\t\tPage.controls.add(plcHold)myReader is a datareader and has the Unique ID I am assigning to the Placeholder.\tThen in my code, I am trying to place a list box in each place holder, like soCODE\t\tPage.findcontrol("MainHold"&dr("templateSpaceVar")).controls.add(selBox)selBox is already defined as a DropDownList.\tHowever, the FindControl returns Null, and doesn't find the PlaceHolders I dynamically created.\tWhat am doing wrong\t
VIEWS ON THIS POST

175

Posted on:

Wednesday 2nd January 2013
View Replies!

__doPostBack General Question

My understanding of the __doPostBack function is that it will load the __EVENTTARGET.value and __EVENTARGUMENT.value with the name of the control that has initiated the "post"\tThis makes perfect sense to me, because this is how the server eventually knows which control's event to fire.BUT... the __doPostBack function IS NOT CREATED if, for example, all you have on your web form are 2 command buttons....and here's my question:\tIf all you have on your web form are to command buttons, and there is no\t__doPostBack function created, how does the server know which of the 2 buttons was clicked\t
VIEWS ON THIS POST

226

Posted on:

Wednesday 2nd January 2013
View Replies!

Iframe equivalent in .NET

Hi allTried searching previous threads but in vain so would like to ask if there is an 'iframe' equivalent of ASP in ASP.NET Any articles / thread / links welcome.
VIEWS ON THIS POST

59

Posted on:

Wednesday 2nd January 2013
View Replies!

How to pass an event from an application object to a certain session.

I have an HttpApplication object oUpdateClient(Winsock control) listening for network messages which fires the NetworkReceive() event. I need to raise an event or something in a specific Session that notifies the user that a certain type of message has arrived. I am using Forms Authentication and I assign a User object(ID,Name,etc.) to a session("SessionUser") variable. Note: of the code mentioned above is in the Global.asax page.
VIEWS ON THIS POST

33

Posted on:

Wednesday 2nd January 2013
View Replies!

Group on a datatable in a dataset

I would like to return an array of rows from datatable. The Array returned should be the datatable rows grouped on certain fields.Ex Dataset table1\t\t3\t\t1242\t\t3\t\t4443\t\t3\t\t4444\t\t3\t\t5555\t\t4\t\t1236\t\t4\t\t123Rows Returned3\t\t1234\t\t1233\t\t4443\t\t555Something likedim dRows() as datarow = _\t\t\tdataset.tablename.Select(\t)or a dataview of the table.
VIEWS ON THIS POST

44

Posted on:

Wednesday 2nd January 2013
View Replies!

Logging Errors

I would like to log exceptions that occur that are not critical but I would still like to know when they happen.\tI tried adding this code in a try/catch (using VB.net)...Catch e As Exception\tSystem.Console.Error.WriteLine(e.ToString)End TryI also tried using System.Console.Out instead of System.Console.Error.\tIn either case, I don't see the error show up in any log file.Is there a simple way to capture exceptions into a log file\tI am using IIS.
VIEWS ON THIS POST

35

Posted on:

Wednesday 2nd January 2013
View Replies!

Printing to Web Server Printer

I'm developing a small web app that takes the users name from a web form and prints it out to a label printer.My problem is that I don't know how to go about printing.\tI do not want to print the web form just the data that the user has entered.\tThe printer is a special label printer but it will be connected from the web server so no client side code needed.I don't know if I should capture the information to a file and then print or ir it can be printed directly.TIAMarc
VIEWS ON THIS POST

91

Posted on:

Wednesday 2nd January 2013
View Replies!

Page Load Event fires twice problem

I have a problem where when I call an ASP.Net page, the page load event fires twice. It doesn't do this when I step through each line of code, but if I do not step through each line of code, or press F5 to continue running during the page load event it fires a asecond time. This happens during a get request and not a postback. The secnd time the page load event fires the page seems to have lost any reference to the session that it was connected with the first time it fires. Very odd behaviour. I have the autoeventwireup property set to false, and none of the controls on the page are set to autopostback.Can anyone shed any light on this and how I may solve it as it is causing real problems
VIEWS ON THIS POST

45

Posted on:

Wednesday 2nd January 2013
View Replies!

Loading Lists From Comma Delimited text files

I want to use comma delimited text files as the sources for the data I use at Page_Load time to populate a web page.\tI'm pretty sure I've seen references to an OLE_DB provider for text in the general ADO capability, but it looks like only a few providers are offered with ADO.NET data objects.\tDoes that mean I can't do it or only that I have to code it\tDoes anyone know what a connection string looks like for csv
VIEWS ON THIS POST

64

Posted on:

Wednesday 2nd January 2013
View Replies!

Simple Question

In Visual Basic.Net I can use the vbCRLF to genereate a line feed, but I know there is a better one in .NEt that is more universal.\tDoes anyone know what this is\t
VIEWS ON THIS POST

91

Posted on:

Wednesday 2nd January 2013
View Replies!

Index Outside the Bounds of the Array

Hi ,I'm trying to develop a control that will allow a page developer to use their own XML documents to populate a page's contents.\tAs such, I'm trying to have the size and contents of an array populated dynamically, as opposed to hard-coded.In the GetArrayContents method below, I'm trying to read the DataColumns from a DataTable and write a string value to be read by the ReadSlides method to populate a jagged array, but I keep getting a "Index Outside the Bounds of the Array" error.\tI thought this would be OK, but apparently not.// set a jagged array of images & captions to use by reading data from an XML file\t\t\t\tprivate string[][] ReadSlides(string filepath)\t\t\t\t{\t\t\t\t\t\tFileStream fs = new FileStream(filepath,FileMode.Open,FileAccess.Read);\t\t\t\t\t\tStreamReader sr = new StreamReader(fs);\t\t\t\t\t\tDataSet ds = new DataSet();\t\t\t\t\t\t\t\t\t\t\t\tds.ReadXml(sr);\t\t\t\t\t\tfs.Close();\t\t\t\t\t\t\t\t\t\t\t\tDataTable table = ds.Tables[0];\t\t\t\t\t\tDataRow[] rows = table.Select();\t\t\t\t\t\t\t\t\t\t\t\tstring[][] contents = new string[rows.Length][];\t\t\t\t\t\tfor(int i=0;i
VIEWS ON THIS POST

79

Posted on:

Wednesday 2nd January 2013
View Replies!