Thursday, March 29, 2012
Newbie: How to start
I have a html page with a form. How can I start turning this into an asp.net
page to including validation and submit processing?
Thanks
Regards
YahyaHey,
Well first things first. Create a web project if you are using Visual
Studio. If not .. you will need to work a bit more and create a virtual
directory and an aspx page. Similar to a normal html page but with lot of
extra tags... Get yourself a good asp.net book.
Now copy the html body and paste it in the aspx file. When you double a html
object like button or image it will be converted to equivalent web control
Have fun learning.. its fun..
Hermit Dave
"John" <john@.nospam.infovis.co.uk> wrote in message
news:%23neTBVQvDHA.2464@.TK2MSFTNGP12.phx.gbl...
> Hi
> I have a html page with a form. How can I start turning this into an
asp.net
> page to including validation and submit processing?
> Thanks
> Regards
>
> Yahya
newbie: inserting data into sql form writes only null values
using VStudio 2005/sql server 2005
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
here's the code:using VStudio 2005/sql server 2005
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
here's the code:
<asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
Last name:
<asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
Address:
<asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
City:
<asp:TextBox ID="City" runat="server"></asp:TextBox><br />
Year created:
<asp:DropDownList ID="YearCreated" runat="server">
</asp:DropDownList><br />
<asp:Button ID="Save" runat="server" Text="Save" />
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString=
"<%$ ConnectionStrings:WHCConnectionString %>"
InsertCommand=
"INSERT INTO
[artsfestival] ([lastName], [firstName], [address], [city])
VALUES
(@.lastName, @.firstName, @.address, @.city)">
<InsertParameters>
<asp:FormParameter Name="lastName" Type="String"
FormField="LastName" />
<asp:FormParameter Name="firstName" Type="String"
FormField="FirstName" />
<asp:FormParameter Name="address" Type="String"
FormField="Address" />
<asp:FormParameter Name="city" Type="String"
FormField="City" />
</InsertParameters>
</asp:SqlDataSource>
"thersitz" <thersitz@.gmail.comwrote in message
news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi,
>
using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value
>
here's the code:
>
>
Hi there,
Use
ControlParameter instead of FormParameter. The difference is that
FormParameter takes its value directly from Request.Form collection using the
name given by FormField. The problem with your vode is that, textbox does not
post its value in Request.Form[textBox.ID] but in
Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
Change you insertparameters declaration to:
<InsertParameters>
<asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
PropertyName="Text"/>
<asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
PropertyName="Text"/>
<asp:ControlParameter Name="address" Type="String" ControlID="Address"
PropertyName="Text"/>
<asp:ControlParameter Name="city" Type="String" ControlID="City"
PropertyName="Text"/>
</InsertParameters>
--
Milosz
"thersitz" wrote:
Quote:
Originally Posted by
using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
>
here's the code:
>
<asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
Last name:
<asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
Address:
<asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
City:
<asp:TextBox ID="City" runat="server"></asp:TextBox><br />
Year created:
<asp:DropDownList ID="YearCreated" runat="server">
</asp:DropDownList><br />
>
<asp:Button ID="Save" runat="server" Text="Save" />
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString=
"<%$ ConnectionStrings:WHCConnectionString %>"
InsertCommand=
"INSERT INTO
[artsfestival] ([lastName], [firstName], [address], [city])
VALUES
(@.lastName, @.firstName, @.address, @.city)">
<InsertParameters>
<asp:FormParameter Name="lastName" Type="String"
FormField="LastName" />
<asp:FormParameter Name="firstName" Type="String"
FormField="FirstName" />
<asp:FormParameter Name="address" Type="String"
FormField="Address" />
<asp:FormParameter Name="city" Type="String"
FormField="City" />
</InsertParameters>
</asp:SqlDataSource>
>
>
>
>
"thersitz" <thersitz@.gmail.comwrote in message
news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi,
using VStudio 2005/sql server 2005
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value
here's the code:
>
>
>
Thanks Milosz, it worked.
I'm confused why the book had me use the FormParameter and FormFieldID --
but thanks for getting me past this point.
Take care.
"Milosz Skalecki [MCAD]" <mily242@.REMOVEITwp.plwrote in message
news:1206D448-EDF2-419B-9A48-D05F7B51FAAF@.microsoft.com...
Quote:
Originally Posted by
Hi there,
>
Use
>
ControlParameter instead of FormParameter. The difference is that
FormParameter takes its value directly from Request.Form collection using
the
name given by FormField. The problem with your vode is that, textbox does
not
post its value in Request.Form[textBox.ID] but in
Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
Change you insertparameters declaration to:
>
<InsertParameters>
<asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
PropertyName="Text"/>
<asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
PropertyName="Text"/>
<asp:ControlParameter Name="address" Type="String" ControlID="Address"
PropertyName="Text"/>
<asp:ControlParameter Name="city" Type="String" ControlID="City"
PropertyName="Text"/>
</InsertParameters>
>
--
Milosz
>
>
"thersitz" wrote:
>
Quote:
Originally Posted by
> using VStudio 2005/sql server 2005
>>
>Have a simple web form that inserts the results in a table. It seems to
>write to the table, but not the values from the asp forms fields. It adds
>a
>new record and increments the id field by one -- but in all the other
>fields, it merely writes Null to the fields. He are some other points:
>>
>I am not inserting data into every field -- for test purposes I am only
>using 4 fields.
>The id field is NOT one of the fields on the asp form -- although it is
>the
>only field that actually writes a correct value
>>
>here's the code:
>>
> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
> Last name:
> <asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
> Address:
> <asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
> City:
> <asp:TextBox ID="City" runat="server"></asp:TextBox><br />
> Year created:
> <asp:DropDownList ID="YearCreated" runat="server">
> </asp:DropDownList><br />
>>
> <asp:Button ID="Save" runat="server" Text="Save" />
> </div>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString=
> "<%$ ConnectionStrings:WHCConnectionString %>"
> InsertCommand=
> "INSERT INTO
> [artsfestival] ([lastName], [firstName], [address], [city])
> VALUES
> (@.lastName, @.firstName, @.address, @.city)">
> <InsertParameters>
> <asp:FormParameter Name="lastName" Type="String"
> FormField="LastName" />
> <asp:FormParameter Name="firstName" Type="String"
> FormField="FirstName" />
> <asp:FormParameter Name="address" Type="String"
> FormField="Address" />
> <asp:FormParameter Name="city" Type="String"
> FormField="City" />
> </InsertParameters>
> </asp:SqlDataSource>
>>
>>
>>
>>
>"thersitz" <thersitz@.gmail.comwrote in message
>news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi,
>
using VStudio 2005/sql server 2005
>
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It
adds
a new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
>
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is
the only field that actually writes a correct value
>
here's the code:
>
>
>>
>>
>>
newbie: inserting data into sql form writes only null values
using VStudio 2005/sql server 2005
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
here's the code:using VStudio 2005/sql server 2005
Have a simple web form that inserts the results in a table. It seems to
write to the table, but not the values from the asp forms fields. It adds a
new record and increments the id field by one -- but in all the other
fields, it merely writes Null to the fields. He are some other points:
I am not inserting data into every field -- for test purposes I am only
using 4 fields.
The id field is NOT one of the fields on the asp form -- although it is the
only field that actually writes a correct value
here's the code:
<asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
Last name:
<asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
Address:
<asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
City:
<asp:TextBox ID="City" runat="server"></asp:TextBox><br />
Year created:
<asp:DropDownList ID="YearCreated" runat="server">
</asp:DropDownList><br />
<asp:Button ID="Save" runat="server" Text="Save" />
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString=
"<%$ ConnectionStrings:WHCConnectionString %>"
InsertCommand=
"INSERT INTO
[artsfestival] ([lastName], [firstName], [address], [city])
VALUES
(@.lastName, @.firstName, @.address, @.city)">
<InsertParameters>
<asp:FormParameter Name="lastName" Type="String"
FormField="LastName" />
<asp:FormParameter Name="firstName" Type="String"
FormField="FirstName" />
<asp:FormParameter Name="address" Type="String"
FormField="Address" />
<asp:FormParameter Name="city" Type="String"
FormField="City" />
</InsertParameters>
</asp:SqlDataSource>
"thersitz" <thersitz@.gmail.com> wrote in message
news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...
> Hi,
> using VStudio 2005/sql server 2005
> Have a simple web form that inserts the results in a table. It seems to
> write to the table, but not the values from the asp forms fields. It adds
> a new record and increments the id field by one -- but in all the other
> fields, it merely writes Null to the fields. He are some other points:
> I am not inserting data into every field -- for test purposes I am only
> using 4 fields.
> The id field is NOT one of the fields on the asp form -- although it is
> the only field that actually writes a correct value
> here's the code:
>
Hi there,
Use
ControlParameter instead of FormParameter. The difference is that
FormParameter takes its value directly from Request.Form collection using th
e
name given by FormField. The problem with your vode is that, textbox does no
t
post its value in Request.Form[textBox.ID] but in
Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
Change you insertparameters declaration to:
<InsertParameters>
<asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
PropertyName="Text"/>
<asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
PropertyName="Text"/>
<asp:ControlParameter Name="address" Type="String" ControlID="Address"
PropertyName="Text"/>
<asp:ControlParameter Name="city" Type="String" ControlID="City"
PropertyName="Text"/>
</InsertParameters>
Milosz
"thersitz" wrote:
> using VStudio 2005/sql server 2005
> Have a simple web form that inserts the results in a table. It seems to
> write to the table, but not the values from the asp forms fields. It adds
a
> new record and increments the id field by one -- but in all the other
> fields, it merely writes Null to the fields. He are some other points:
> I am not inserting data into every field -- for test purposes I am only
> using 4 fields.
> The id field is NOT one of the fields on the asp form -- although it is th
e
> only field that actually writes a correct value
> here's the code:
> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox><br />
> Last name:
> <asp:TextBox ID="LastName" runat="server"></asp:TextBox><br />
> Address:
> <asp:TextBox ID="Address" runat="server"></asp:TextBox><br />
> City:
> <asp:TextBox ID="City" runat="server"></asp:TextBox><br />
> Year created:
> <asp:DropDownList ID="YearCreated" runat="server">
> </asp:DropDownList><br />
> <asp:Button ID="Save" runat="server" Text="Save" />
> </div>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString=
> "<%$ ConnectionStrings:WHCConnectionString %>"
> InsertCommand=
> "INSERT INTO
> [artsfestival] ([lastName], [firstName], [address], [city])
> VALUES
> (@.lastName, @.firstName, @.address, @.city)">
> <InsertParameters>
> <asp:FormParameter Name="lastName" Type="String"
> FormField="LastName" />
> <asp:FormParameter Name="firstName" Type="String"
> FormField="FirstName" />
> <asp:FormParameter Name="address" Type="String"
> FormField="Address" />
> <asp:FormParameter Name="city" Type="String"
> FormField="City" />
> </InsertParameters>
> </asp:SqlDataSource>
>
>
> "thersitz" <thersitz@.gmail.com> wrote in message
> news:OhRMtSXRHHA.2256@.TK2MSFTNGP02.phx.gbl...
>
>
Thanks Milosz, it worked.
I'm
but thanks for getting me past this point.
Take care.
"Milosz Skalecki [MCAD]" <mily242@.REMOVEITwp.pl> wrote in message
news:1206D448-EDF2-419B-9A48-D05F7B51FAAF@.microsoft.com...
> Hi there,
> Use
> ControlParameter instead of FormParameter. The difference is that
> FormParameter takes its value directly from Request.Form collection using
> the
> name given by FormField. The problem with your vode is that, textbox does
> not
> post its value in Request.Form[textBox.ID] but in
> Request.Form[textBox.UniqueID] which reflects IDs of the parent controls.
> Change you insertparameters declaration to:
> <InsertParameters>
> <asp:ControlParameter Name="lastName" Type="String" ControlID="LastName"
> PropertyName="Text"/>
> <asp:ControlParameter Name="firstName" ControlID="FirstName" Type="String"
> PropertyName="Text"/>
> <asp:ControlParameter Name="address" Type="String" ControlID="Address"
> PropertyName="Text"/>
> <asp:ControlParameter Name="city" Type="String" ControlID="City"
> PropertyName="Text"/>
> </InsertParameters>
> --
> Milosz
>
> "thersitz" wrote:
>
Monday, March 26, 2012
Newbie: Open other form when link is clicked
form (Login.aspx) when user clicks this link. How to do this? I also
want to maintain site map when another form gets opened."Rohit" <rpk.general@.gmail.comwrote in message
news:1192811576.682143.41250@.e34g2000pro.googlegro ups.com...
Quote:
Originally Posted by
I have a hyperlink on my Web form (home.aspx). I want to open another
form (Login.aspx) when user clicks this link. How to do this?
Well, the obvious answer is to change the hyperlink to point to Login.aspx
instead of home.aspx, but I guess that's not what you really mean...
Can you explain in a bit more detail what you're trying to do...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
In the client-side click event of the link, call window.open ('popup.aspx");
"Rohit" wrote:
Quote:
Originally Posted by
I have a hyperlink on my Web form (home.aspx). I want to open another
form (Login.aspx) when user clicks this link. How to do this? I also
want to maintain site map when another form gets opened.
>
>
Saturday, March 24, 2012
Newbie: Removing underline from Hyperlink
I've added hyperlink objects to a web form & I would like to display them
without the underline. How can I do this?
The element in HTML appears to be <asp:Hyperlink
thus in a stylesheet:
asp:HyperLink
{
text-decoration:none
}
I tried to set this up in a stylesheet but no go.
How can i state a hyperlink object in a style sheet, or some other way to do
this?
Many thanks for any ideas on this
AntOn Sep 29, 10:13 am, Ant <A...@.discussions.microsoft.comwrote:
Quote:
Originally Posted by
Hi,
I've added hyperlink objects to a web form & I would like to display them
without the underline. How can I do this?
The element in HTML appears to be <asp:Hyperlink
>
thus in a stylesheet:
>
asp:HyperLink
{
text-decoration:none
>
}
>
I tried to set this up in a stylesheet but no go.
>
How can i state a hyperlink object in a style sheet, or some other way to do
this?
>
Many thanks for any ideas on this
>
Ant
for all links
a
{
text-decoration:none
}
per control
a.c1
{
text-decoration:none
}
...
<asp:HyperLink ... class="c1"...
Newbie: Selecting image from separate aspx page
would be better to allow them to select the image itself rather than key
in the filename.
So, I have a server side directory with the available images. And I have
a page which shows the images as ImageButtons.
My question is: What's the best way to link the two?
Should MyForm.aspx redirect to ImageList.aspx passing "MyForm" in the
query string so that ImageList knows where to redirect back to? It works
but it seems a bit convoluted so I think it must be wrong.
How do you solve this when basically you want to pick from a list of
things which aren't on the calling page?
Hope this makes sense.
In the desktop app environment I'd just open a dialog box. what is the
asp.net paradigm?You could simulate a dialog box by using window.open("ImageBox.aspx")
and then add some javascript in the onclick of the Select Button in
the ImageBox codebehind, which
- sets the image in the calling page (window.opener.getElementByID...)
- closes the imagebox window
So - mainly you have to deal with some javascript and DHTML
As to your original question: For easy pageflows I just put the
refering
page in the session/context items/request, which is not elegant, but
simple.
Alternatively you can implement a pageflow manager which can take
care of more complex navigations. Also worth looking at is
Server.Execute instead of redirect or transfer (and having a refering
page property defined in a page base class). There are really
a lot of options here and it is up to your preferences and requirements
to decide which one you want to go with.
-Stefan
Newbie: Selecting image from separate aspx page
would be better to allow them to select the image itself rather than key
in the filename.
So, I have a server side directory with the available images. And I have
a page which shows the images as ImageButtons.
My question is: What's the best way to link the two?
Should MyForm.aspx redirect to ImageList.aspx passing "MyForm" in the
query string so that ImageList knows where to redirect back to? It works
but it seems a bit convoluted so I think it must be wrong.
How do you solve this when basically you want to pick from a list of
things which aren't on the calling page?
Hope this makes sense.
In the desktop app environment I'd just open a dialog box. what is the
asp.net paradigm?You could simulate a dialog box by using window.open("ImageBox.aspx")
and then add some javascript in the onclick of the Select Button in
the ImageBox codebehind, which
- sets the image in the calling page (window.opener.getElementByID...)
- closes the imagebox window
So - mainly you have to deal with some javascript and DHTML
As to your original question: For easy pageflows I just put the
refering
page in the session/context items/request, which is not elegant, but
simple.
Alternatively you can implement a pageflow manager which can take
care of more complex navigations. Also worth looking at is
Server.Execute instead of redirect or transfer (and having a refering
page property defined in a page base class). There are really
a lot of options here and it is up to your preferences and requirements
to decide which one you want to go with.
-Stefan
Thanks Stefan.
I guess the session is a better place rather than clogging up the
querystring. I think I need a bit of practise to get into Web way of
doing things.
Colin
Stefan wrote:
> You could simulate a dialog box by using window.open("ImageBox.aspx")
> and then add some javascript in the onclick of the Select Button in
> the ImageBox codebehind, which
> - sets the image in the calling page (window.opener.getElementByID...)
> - closes the imagebox window
> So - mainly you have to deal with some javascript and DHTML
> As to your original question: For easy pageflows I just put the
> refering
> page in the session/context items/request, which is not elegant, but
> simple.
> Alternatively you can implement a pageflow manager which can take
> care of more complex navigations. Also worth looking at is
> Server.Execute instead of redirect or transfer (and having a refering
> page property defined in a page base class). There are really
> a lot of options here and it is up to your preferences and requirements
> to decide which one you want to go with.
> -Stefan
>
Thursday, March 22, 2012
newbie??
I'm new to this forum and the asp.net enviroment...so execuse the nub questions.........Heres my question....I am creating a form where you input various information...on one part you input your personal information (first name , last name , etc ) ...with an add button ...I'm trying to get the information to display in a textarea(html control) when you click add. Every time you click add it jumps to the next line in the textarea and print the new information......I'm not sure if textarea is the bext tool to use.....and i can't seem to get anything displayed in the text area any help is greatly appreciated....So, you have a bunch of text boxes for collecting user information, a button, and a multiline text box?
Do you have any plans to persist the data, like in session state or a database? Or you just want to concatenate all of the fields into one string with each field taking up one line -- and you want that string inserted into a multiline textbox upon pressing the button on your page?
Correct, I have multiply text box for user to enter information and and multiply buttons for add, delete, search etc...I am also going to stored the information in a sql database.....I am trying to set up a multiline text box to display the information that was entered so the user can see what they have entered ...i am trying to use the html text area to display the information but i am having trouble with using the text area....is there a better type of multiline text box i can use other than a text area?
can anyone help?
I think it is a wise idea to take a look at the possible solution to use a datagrid. It is a little bit more work. But it looks better and is in the long run easier to maintain (if your design is right)
This is totaly depending what are you gone use it for.
Hello,
Why not using text box server control?
Textbox1.text &= txtfirstname.text & " " & txtlastname.text
is that what you need?
HTH
regards
thanks for all the help.....i decided to use the a data grid......the textbox idea was great but i need it to display the user information in seperate lines.........again thanks for the help..
hello
I'm back again...well i was using the dataview for displaying user input.....the new problem is that i need a text area or what ever is better to display user information with out saving it to the database ......theres other information that needs to be completed before it can be saved to the database............the layout --> the page is in 2 parts -- part 1 is user infor, part 2 is a survey information, all information is added to the DB at the end of the form ....I am trying to set up a textarea so that when the user click add at part 1 he can see the names that is going to be added to the db if he made a mistake he can delete it......after user infor is added the user then proceed to part 2 of the form after he completes the form he can add all info to the DB... any help willl be greatly appreciated
is there a way i can bind textbox to the dataview colums...
My new solution is to us a textbox and set the multi line option on ..here is an example of my new problem --> ex: i have created 3 text box , 1 being the text box with multiline to act as a text area. I also added an submit button so user can click the button and display what they have inputed into the other 2 text box...my problem is how can i get the text area to go to the next line every time a user click submit.....ex: textbox 1 =id lastname ; textboxt 2 = id fisrtname ; textbox 3 =id text area.....and button id = submit...any help is greatly appreiciated
Newbiew use of DropDownList.
I think this is the first time I put a dropdownlist in a web form, it
correctly displays the values from the database and when I save the
form I'm able to save the corresponding value to the database. But when
I use the form to display data, the listbox does not automatically
display the value saved in the database of course, so how am I supposed
to make point to the saved value ?Hi,
You can do it one of two ways.
(after ddl is populated)
DropDownList.SelectedIndex =
DropDownList.Items.IndexOf(DropDownList.Items.FindByText(MyDataReader("Field
Name")))
or
(if before ddl is populated)
DropDownList.DataTextField=MyDataReader("FieldName")
I hope this helps.
Mike Douglas
On 26 Mar 2005 16:17:20 -0800, craigkenisston@.hotmail.com wrote:
>Hi,
>I think this is the first time I put a dropdownlist in a web form, it
>correctly displays the values from the database and when I save the
>form I'm able to save the corresponding value to the database. But when
>I use the form to display data, the listbox does not automatically
>display the value saved in the database of course, so how am I supposed
>to make point to the saved value ?
Newbiew use of DropDownList.
I think this is the first time I put a dropdownlist in a web form, it
correctly displays the values from the database and when I save the
form I'm able to save the corresponding value to the database. But when
I use the form to display data, the listbox does not automatically
display the value saved in the database of course, so how am I supposed
to make point to the saved value ?Hi,
You can do it one of two ways.
(after ddl is populated)
DropDownList.SelectedIndex =
DropDownList.Items.IndexOf(DropDownList.Items.Find ByText(MyDataReader("FieldName")))
or
(if before ddl is populated)
DropDownList.DataTextField=MyDataReader("FieldName")
I hope this helps.
Mike Douglas
On 26 Mar 2005 16:17:20 -0800, craigkenisston@.hotmail.com wrote:
>Hi,
>I think this is the first time I put a dropdownlist in a web form, it
>correctly displays the values from the database and when I save the
>form I'm able to save the corresponding value to the database. But when
>I use the form to display data, the listbox does not automatically
>display the value saved in the database of course, so how am I supposed
>to make point to the saved value ?
newby needs no record found help
Edited by SomeNewKid. Please post code between<code> and</code> tags.
ASP protion of page
<%
strSearch = Request.Form("search")If strSearch <> "" Then
Dim strConnect, SQL
Dim RS
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("securefiles/ITtracking.mdb") & ";"SQL = "SELECT * FROM ITTable WHERE INSTR(ITTable.ITNumber,'" & strSearch & "')"
Set RS = Server.CreateObject("Adodb.Recordset") 'Used for pulling main categories from DB
RS.Open SQL,strConnect'If Len(strSearch) > 1 AND LCase(strSearch) = LCase(RS("Name")) Then
Response.Write RS("ITNumber") & "<BR><BR>"
Response.Write RS("DateArrived") & "<BR><BR>"
Response.Write RS("RefNumber") & "<BR><BR>"
Response.Write RS("Quantity") & "<BR><BR>"
Response.Write RS("PUDate") & "<BR><BR>"
Response.Write RS("PUNumber") & "<BR><BR>"
Response.Write RS("OriginalIT") & "<BR><BR>"
Response.Write RS("ValidatedIT") & "<BR><BR>"
Response.Write RS("CustomsRelease") & "<BR><BR>"
Response.Write RS("ShippingTally") & "<BR><BR>"
Response.Write RS("NVOCCRelease") & "<BR><BR>"
Response.Write RS("PaperlessIT") & "<BR><BR>"
'End If'If Len(strSearch) <= 0 Then
'Response.Write "Sorry no record & "<BR>"
'Response.Write RS(sorry no record) & "<BR><BR>"'End If
RS.MoveNext
RS.Close
End If
%>
Friday, March 16, 2012
NewPageIndex error
Imports System.Data.OleDbImports fish.configuration1Public Class CheckReplyFeedbacksInherits System.Web.UI.PageDim dsAs DataSet#Region" Web Form Designer Generated Code "'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()>Private Sub InitializeComponent()End Sub Protected WithEvents lbCRFBAs System.Web.UI.WebControls.LabelProtected WithEvents lbLoggerAs System.Web.UI.WebControls.LabelProtected WithEvents dtgCheckReplyFIAs System.Web.UI.WebControls.DataGrid'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it.Private designerPlaceholderDeclarationAs System.Object Private Sub Page_Init(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles MyBase.Init'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent()End Sub#End Region Private Sub Page_Load(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles MyBase.Load'Put user code to initialize the page here 'load_data()Dim config1As New fish.configuration1 ds = config1.load_data("select * from feedback") bind_data()End Sub Public Sub page_change(ByVal senderAs Object,ByVal eAs DataGridCommandEventArgs) dtgCheckReplyFI.CurrentPageIndex =e.NewPageIndex'load_data() bind_data()End Sub Private Sub bind_data() dtgCheckReplyFI.DataSource = ds dtgCheckReplyFI.DataBind()End SubEnd Class
hello, im doing a paging grid. may i know what is wrong with this code.. because the code in purple keep giving " NewPageIndex" is not a member of 'System.Web.UI.Webcontrols.DataGridCommandEventArgs'. what should i do?
jellyfied
I see 2 things here:
1. Your DataGrid must contain an attribute specifying which method to fire on the page index change event. You do that like this:
<asp:DataGrid id="DataGrid1" OnPageIndexChanged="Page_Change" runat="server"></asp:DataGrid>
2. Your page_change method contains the wrong definition. This is the correct definition:
Protected Sub Page_Change(ByVal sourceAs Object,ByVal eAs System.Web.UI.WebControls.DataGridPageChangedEventArgs)
Hi
DataGridCommandEventArgs doesnt contain NewPageIndex. You are passing the wrong
event arguments. It should be DataGridPageChangedEventArgs as told by jstawskiThanks
news form!
What is a news form?
news form is form for news.
Google is your friend. :bigyello:
http://www.google.com/search?hs=0GV&hl=en&lr=&safe=active&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial_s&q=Programming+ASP.Net+%22News+form%22&btnG=Search