Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Saturday, March 31, 2012

TExt Box :-( image

Dear Advance,

How to save image from a given textbox text.

Regards,

Kamrul Hassan

huh?

You can't... if you want the client to upload an image use the upload control.... you can't pull a file off the client PC...thank heaven...

Text box

Hello can anybody write me how to clear text from texbox after I click on button

Hi

on Button's Click event (after you've read the Text) set

[VB]
TextBox1.Text = ""

[C#]
TextBox1.Text = "";

assuming your TextBox's ID isTextBox1


Use something like this in the click event handler of the button:

TextBox1.Text = "";

(where TextBox1 is the ID of your text box)

Regards,
Martin


This method: TextBox1.Text = ""; is not fast, because you make request on server ,optimal use JavaScript on ClientMachine:function f(){tbx.value="";}

Text Box

Hi,

I have an update button click event like this :

lblmessage.text = txtAuthor.text;

Even though I manually change the data in text box, somehow it does not show on to the label field.Whatever value I put in txtAuthor the label field is empty.

Any help is greatly appreciated. I hope I have framed my question properly.

With the semi-colon after the line, it looks like C#, so, just in case - what language are you using (VB or C#)?

augustwind:

With the semi-colon after the line, it looks like C#, so, just in case - what language are you using (VB or C#)?

I am using C#. Actually the updated data from the textbox goes to the property of an object. But when I found there was a problem I created a label control to see if the data is being read from the text box. But no data is being read from the text box.


Well - I don't really know what to tell you - it definitely should work.

Save it again - and rebuild - then run it, and put a break point at the code line and see if it ever hits that line.


Are u changing the value of the textbox in the page load, because that event is fired first.

Hope this helps

Thanks

Vikram

Vikram's Blog


Are you using Visual Web Developer? I have the same problem sometime when trying to get the values for update/.

Thanks


e_screw:

Are you using Visual Web Developer? I have the same problem sometime when trying to get the values for update/.

Thanks

I am using the Full blown edition of VS. I guess as Vikram suggested I am gonna have to check the code in the page load event.


Thanks a lot for the reply guys. I was able to fix the problem.

The problem was that I was pulling the data from the database in the page load event. And whenever I click the update button the original data from teh DB get loaded due to the page load event firing first. So there was no update taking place. Hence the label control which was pulling the data from the textbox was pulling the original data instead of the updated data... I hope I make sense in what I said.

I fixed it by adding the code for pulling data from the DB inside the " if (! IsPostBack) { } " block within the page load event. That fixed the problem in the test page that I created. I havent yet tested it on other pages that I am having trouble with. Hope fully I have resolved the problem. Thanks to Vikram for pointing out the Page Load event.

Text box

Could someone help me.

After hitting the submit page how do get the text box to clear? The
page is posting back to itself. What do I put on the code behind page?Just change the "EnableViewState" property of the Textbox to "False" in the
Properties Windows at design-time. No code necessary.

"JJ297" <nc297@.yahoo.comwrote in message
news:1193771080.275874.158090@.y42g2000hsy.googlegr oups.com...

Quote:

Originally Posted by

Could someone help me.
>
After hitting the submit page how do get the text box to clear? The
page is posting back to itself. What do I put on the code behind page?
>


"JJ297" <nc297@.yahoo.comwrote in message
news:1193771080.275874.158090@.y42g2000hsy.googlegr oups.com...

Quote:

Originally Posted by

After hitting the submit page how do get the text box to clear? The
page is posting back to itself.


The submit page...?

Quote:

Originally Posted by

What do I put on the code behind page?


What are you trying to do exactly...?

Please clarify precisely what you mean...

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
IMO it won't work as persisting the texbox content is not done using
viewstate. By design field values are posted to a server (this is how an
HTML form works). The viewstate is there for any other property you could
have to maintain between postbacks except the textbox content).

Your best bet is to explicitelty set the value to an empty string in the
submit button event handler...

--
Patrice

"Scott M." <s-mar@.nospam.nospama crit dans le message de news:
udr8XiyGIHA.1184@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Just change the "EnableViewState" property of the Textbox to "False" in
the Properties Windows at design-time. No code necessary.
>
>
"JJ297" <nc297@.yahoo.comwrote in message
news:1193771080.275874.158090@.y42g2000hsy.googlegr oups.com...

Quote:

Originally Posted by

>Could someone help me.
>>
>After hitting the submit page how do get the text box to clear? The
>page is posting back to itself. What do I put on the code behind page?
>>


>
>


Just add this to your code:
MyTextBox.text=""

--

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup

"JJ297" <nc297@.yahoo.comwrote in message
news:1193771080.275874.158090@.y42g2000hsy.googlegr oups.com...

Quote:

Originally Posted by

Could someone help me.
>
After hitting the submit page how do get the text box to clear? The
page is posting back to itself. What do I put on the code behind page?
>


On Oct 30, 3:37 pm, "David Wier" <d...@.dw.comwrote:

Quote:

Originally Posted by

Just add this to your code:
MyTextBox.text=""
>
--
>
David Wierhttp://aspnet101.comhttp://iWritePro.com- One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
>
"JJ297" <nc...@.yahoo.comwrote in message
>
news:1193771080.275874.158090@.y42g2000hsy.googlegr oups.com...
>
>
>

Quote:

Originally Posted by

Could someone help me.


>

Quote:

Originally Posted by

After hitting the submit page how do get the text box to clear? The
page is posting back to itself. What do I put on the code behind page?- Hide quoted text -


>
- Show quoted text -


Thanks I added the text to my code and the box is now clear after
hitting the submit button.
On Oct 30, 3:37 pm, "David Wier" <d...@.dw.comwrote:

Quote:

Originally Posted by

Just add this to your code:
MyTextBox.text=""
>
--
>
David Wierhttp://aspnet101.comhttp://iWritePro.com- One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
>
"JJ297" <nc...@.yahoo.comwrote in message
>
news:1193771080.275874.158090@.y42g2000hsy.googlegr oups.com...
>
>
>

Quote:

Originally Posted by

Could someone help me.


>

Quote:

Originally Posted by

After hitting the submit page how do get the text box to clear? The
page is posting back to itself. What do I put on the code behind page?- Hide quoted text -


>
- Show quoted text -


Thanks it worked!

Text Box

I have a asp.net textbox on my page with a default value in it. I would like
the box to be cleared when some one clicks on the box.
How do I go about doing this?you need to add some client-side javascript like this:

onfocus=" if ( this.value == 'some default' ) this.value=''; " onblur="
if ( this.value == '' ) this.value = 'some default' ; "

Lou Civitella wrote:

Quote:

Originally Posted by

I have a asp.net textbox on my page with a default value in it. I would like
the box to be cleared when some one clicks on the box.
How do I go about doing this?

Text Box and Image Button

Hello,

I added a TextBox and an Image Button to a page so that they are side
by side.
Instead of both being top aligned the Text Box is pushed down.

Why is that?
How can I solve this?

Thanks,
MiguelHi there again,

<asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Top" />
<asp:TextBox ID="TextBox2" runat="server" />

or

<table>
<tr>
<td valign="top">
<asp:ImageButton ID="ImageButton2" runat="server" />
</td>
<td valign="top">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
</table>

or

<div>
<div style="float:left">
<asp:ImageButton ID="ImageButton3" runat="server" />
</div>
<asp:TextBox ID="TextBox3" runat="server" />
</div>
--
Milosz

"shapper" wrote:

Quote:

Originally Posted by

Hello,
>
I added a TextBox and an Image Button to a page so that they are side
by side.
Instead of both being top aligned the Text Box is pushed down.
>
Why is that?
How can I solve this?
>
Thanks,
Miguel
>
>

Text Box and Image Button

Hello,
I added a TextBox and an Image Button to a page so that they are side
by side.
Instead of both being top aligned the Text Box is pushed down.
Why is that?
How can I solve this?
Thanks,
MiguelHi there again,
<asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Top" />
<asp:TextBox ID="TextBox2" runat="server" />
or
<table>
<tr>
<td valign="top">
<asp:ImageButton ID="ImageButton2" runat="server" />
</td>
<td valign="top">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
</table>
or
<div>
<div style="float:left">
<asp:ImageButton ID="ImageButton3" runat="server" />
</div>
<asp:TextBox ID="TextBox3" runat="server" />
</div>
--
Milosz
"shapper" wrote:

> Hello,
> I added a TextBox and an Image Button to a page so that they are side
> by side.
> Instead of both being top aligned the Text Box is pushed down.
> Why is that?
> How can I solve this?
> Thanks,
> Miguel
>

Text box and Gridview on same page

How do I get the validation not to fire if I'm updating a gridview on
the page. When I try to update the item in the gridview the text box
won't allow me to update because of its validation set for that text
box. How do I get around this I need the validation on the text box
too. Here's my page.
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<center style="color: #006666">
<strong><span style="font-family: Arial; text-decoration:
underline">
Add a Topic</span></strong></center>
<center>
<asp:Label ID="Lbloutcome1" runat="server" ForeColor="Red"></
asp:Label> </center>
<center>
<asp:TextBox ID="TopicTxt" runat="server" TextMode="MultiLine"
Width="334px" EnableViewState="False" CausesValidation="True"></
asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ControlToValidate="TopicTxt"
ErrorMessage="Enter a Topic">
*</asp:RequiredFieldValidator><br />
<asp:Label ID="LblMsg" runat="server"></asp:Label><br />
<asp:ValidationSummary ID="ValidationSummary1" runat="server" /
>
<br />
<asp:Button ID="Button1" runat="server" Text="Submit" />
<asp:Button ID="Button2" runat="server" Text="Reset"
CausesValidation="False" />
<br />
<br />
<asp:Label ID="Lbloutcome" runat="server" ForeColor="Red"
Width="237px"></asp:Label><br />
<asp:Label ID="Lbloutcome3" runat="server" ForeColor="Red"></
asp:Label><br />
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" DataKeyNames="classificationid"
DataSourceID="TopicsSqlDataSource"
AutoGenerateEditButton="True" BorderColor="#8E7953" BorderWidth="1px"
Width="209px" EnableViewState="False">
<Columns>
<asp:TemplateField HeaderText="Topic"
SortExpression="description">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Bind("description") %>' Height="46px" Width="239px"></
asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<
%# Bind("description") %>'></asp:Label>
</ItemTemplate>
<ItemStyle BorderColor="#8E7953"
BorderStyle="Solid" />
<HeaderStyle BorderColor="#8E7953" Font-
Bold="True" Font-Size="Large" ForeColor="#006666" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete Topic"
InsertVisible="False" SortExpression="classificationid">
<ItemTemplate>
<asp:Label ID="classificationid"
runat="server" Font-Bold="True" Text='<%# DataBinder.Eval
(Container.DataItem, "classificationID") %>'
Visible="False"></asp:Label>
<asp:CheckBox ID="deleteRec" runat="server"
Font-Bold="True" />
</ItemTemplate>
<ItemStyle BorderColor="#8E7953" />
<HeaderStyle BorderColor="#8E7953" Font-
Bold="True" Font-Size="Large" ForeColor="#006666" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<br />
<asp:Button ID="Button3" runat="server" Text="Delete
Topic" CausesValidation="False" /><br />
<br />
<br />
<strong><span style="font-size: 14pt; color: #006666; font-
family: Arial; text-decoration: underline">
</span></strong>
<br />
<a href="http://links.10026.com/?link=AddTitle_Description.aspx" id="AddResourceAdminLink"
runat="server">Add a Resource</a><br />
<br />
<a href="http://links.10026.com/?link=EditResoureLibrary.aspx" id="EditResourceAdminLink"
runat="server">Edit Resource Library Information</a><br />
<br />
<br />
<table>
<tr>
<td style="width: 100px">
<a href="http://links.10026.com/?link=http://philanet/">
<img alt="PhilaNet" border="0" src="http://pics.10026.com/?src=Images/
philanet_small.gif" /></a></td>
<td style="width: 175px">
<a href="http://links.10026.com/?link=ResourceLibrary.aspx"><strong><span
style="font-size: 14pt">Resource Library</span></strong></a></td>
</tr>
</table>
<br />
<asp:SqlDataSource ID="TopicsSqlDataSource"
runat="server" ConnectionString="<%$
ConnectionStrings:TrainUserConnectionStr
ing %>"
SelectCommand="GetClassifications"
SelectCommandType="StoredProcedure" UpdateCommand="UpdateTopic"
UpdateCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="classificationID" Type="Int32" />
<asp:Parameter Name="description" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
<br />
</center>
</asp:Content>Checkout the ValidationGroup property.
"JJ297" <nc297@.yahoo.com> wrote in message
news:1194986781.386224.323330@.o3g2000hsb.googlegroups.com...
> How do I get the validation not to fire if I'm updating a gridview on
> the page. When I try to update the item in the gridview the text box
> won't allow me to update because of its validation set for that text
> box. How do I get around this I need the validation on the text box
> too. Here's my page.
> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
> Runat="Server">
> <center style="color: #006666">
> <strong><span style="font-family: Arial; text-decoration:
> underline">
> Add a Topic</span></strong></center>
> <center>
> <asp:Label ID="Lbloutcome1" runat="server" ForeColor="Red"></
> asp:Label> </center>
> <center>
> <asp:TextBox ID="TopicTxt" runat="server" TextMode="MultiLine"
> Width="334px" EnableViewState="False" CausesValidation="True"></
> asp:TextBox>
> <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
> runat="server" ControlToValidate="TopicTxt"
> ErrorMessage="Enter a Topic">
> *</asp:RequiredFieldValidator><br />
> <asp:Label ID="LblMsg" runat="server"></asp:Label><br />
> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /
> <br />
> <asp:Button ID="Button1" runat="server" Text="Submit" />
> <asp:Button ID="Button2" runat="server" Text="Reset"
> CausesValidation="False" />
> <br />
> <br />
> <asp:Label ID="Lbloutcome" runat="server" ForeColor="Red"
> Width="237px"></asp:Label><br />
> <asp:Label ID="Lbloutcome3" runat="server" ForeColor="Red"></
> asp:Label><br />
> <asp:GridView ID="GridView1" runat="server"
> AutoGenerateColumns="False" DataKeyNames="classificationid"
> DataSourceID="TopicsSqlDataSource"
> AutoGenerateEditButton="True" BorderColor="#8E7953" BorderWidth="1px"
> Width="209px" EnableViewState="False">
> <Columns>
> <asp:TemplateField HeaderText="Topic"
> SortExpression="description">
> <EditItemTemplate>
> <asp:TextBox ID="TextBox1" runat="server"
> Text='<%# Bind("description") %>' Height="46px" Width="239px"></
> asp:TextBox>
> </EditItemTemplate>
> <ItemTemplate>
> <asp:Label ID="Label1" runat="server" Text='<
> %# Bind("description") %>'></asp:Label>
> </ItemTemplate>
> <ItemStyle BorderColor="#8E7953"
> BorderStyle="Solid" />
> <HeaderStyle BorderColor="#8E7953" Font-
> Bold="True" Font-Size="Large" ForeColor="#006666" />
> </asp:TemplateField>
> <asp:TemplateField HeaderText="Delete Topic"
> InsertVisible="False" SortExpression="classificationid">
> <ItemTemplate>
> <asp:Label ID="classificationid"
> runat="server" Font-Bold="True" Text='<%# DataBinder.Eval
> (Container.DataItem, "classificationID") %>'
> Visible="False"></asp:Label>
> <asp:CheckBox ID="deleteRec" runat="server"
> Font-Bold="True" />
> </ItemTemplate>
> <ItemStyle BorderColor="#8E7953" />
> <HeaderStyle BorderColor="#8E7953" Font-
> Bold="True" Font-Size="Large" ForeColor="#006666" />
> </asp:TemplateField>
> </Columns>
> </asp:GridView>
> <br />
> <br />
> <asp:Button ID="Button3" runat="server" Text="Delete
> Topic" CausesValidation="False" /><br />
> <br />
> <br />
> <strong><span style="font-size: 14pt; color: #006666; font-
> family: Arial; text-decoration: underline">
> </span></strong>
> <br />
> <a href="http://links.10026.com/?link=AddTitle_Description.aspx" id="AddResourceAdminLink"
> runat="server">Add a Resource</a><br />
> <br />
> <a href="http://links.10026.com/?link=EditResoureLibrary.aspx" id="EditResourceAdminLink"
> runat="server">Edit Resource Library Information</a><br />
> <br />
> <br />
> <table>
> <tr>
> <td style="width: 100px">
> <a href="http://links.10026.com/?link=http://philanet/">
> <img alt="PhilaNet" border="0" src="http://pics.10026.com/?src=Images/
> philanet_small.gif" /></a></td>
> <td style="width: 175px">
> <a href="http://links.10026.com/?link=ResourceLibrary.aspx"><strong><span
> style="font-size: 14pt">Resource Library</span></strong></a></td>
> </tr>
> </table>
> <br />
> <asp:SqlDataSource ID="TopicsSqlDataSource"
> runat="server" ConnectionString="<%$
> ConnectionStrings:TrainUserConnectionStr
ing %>"
> SelectCommand="GetClassifications"
> SelectCommandType="StoredProcedure" UpdateCommand="UpdateTopic"
> UpdateCommandType="StoredProcedure">
> <UpdateParameters>
> <asp:Parameter Name="classificationID" Type="Int32" />
> <asp:Parameter Name="description" Type="String" />
> </UpdateParameters>
> </asp:SqlDataSource>
> <br />
> </center>
> </asp:Content>
>
On Nov 13, 4:02 pm, "J055" <j...@.newsgroups.nospam> wrote:
> Checkout the ValidationGroup property.
> "JJ297" <nc...@.yahoo.com> wrote in message
> news:1194986781.386224.323330@.o3g2000hsb.googlegroups.com...
>
>
>
>
> - Show quoted text -
Thanks it worked!

Text Box and URL

it's not an asp issue, that's html
<body link=blue vlink=blue
and as for yout textbox/dropdown list question...It's unclear to me what you
are asking?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"Hong" <anonymous@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:DC295FB3-91C8-44E3-B002-8CFA3C31AF6C@dotnet.itags.org.microsoft.com...
> Once I click on the url, it will change to purple color permanetly even i
stop the program and run it again. How to change the url color back to blue
color ?
> For text box, how to remove the dropdown list ??You can turn off autocomplete for the form or for individual text boxes.
See this article:

http://msdn.microsoft.com/workshop/...omplete_ovr.asp

-Jason

Curt_C [MVP] wrote:

> it's not an asp issue, that's html
> <body link=blue vlink=blue>
> and as for yout textbox/dropdown list question...It's unclear to me what you
> are asking?

Text Box and URL

Once I click on the url, it will change to purple color permanetly even i st
op the program and run it again. How to change the url color back to blue co
lor ?
For text box, how to remove the dropdown list 'it's not an asp issue, that's html
<body link=blue vlink=blue>
and as for yout textbox/dropdown list question...It's unclear to me what you
are asking?
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Hong" <anonymous@.discussions.microsoft.com> wrote in message
news:DC295FB3-91C8-44E3-B002-8CFA3C31AF6C@.microsoft.com...
> Once I click on the url, it will change to purple color permanetly even i
stop the program and run it again. How to change the url color back to blue
color ?
> For text box, how to remove the dropdown list '
You can turn off autocomplete for the form or for individual text boxes.
See this article:
http://msdn.microsoft.com/workshop/...omplete_ovr.asp
-Jason
Curt_C [MVP] wrote:

> it's not an asp issue, that's html
> <body link=blue vlink=blue>
> and as for yout textbox/dropdown list question...It's unclear to me what y
ou
> are asking?
>
Use a style or css to set the color of the A element.
Dale
"Hong" <anonymous@.discussions.microsoft.com> wrote in message
news:DC295FB3-91C8-44E3-B002-8CFA3C31AF6C@.microsoft.com...
> Once I click on the url, it will change to purple color permanetly even i
stop the program and run it again. How to change the url color back to blue
color ?
> For text box, how to remove the dropdown list '

Text Box and submit button not visible on the browser

Hi,
I am new to this group and to ASP.Net. I wrote a simple .aspx program in VS.Net environment. It has a label control, TextBox control and a button control. When the page is viewed on the browser, one enters their name or whatever and click the submit button, the resulting page shoul display "Hello and the text from the text box. I added required code in the button click event. The problem is when the page is loaded first time on the browser, I see only the label contol with the text that I entered before. Text Box and the Button controls are not visible. Any clues??
thanks.do you have runat=server for both?
Make sure that you have runat="server" in the html for the textbox and button...and make sure you have not set the visible property to false

MajorCats
I do have runat="server" and the Visible properties are set to False. Still it is not working. any other clues?...
After playing around with the code, I realized that none of my web controls are visible in the browser. If I change the following code
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
to
<input type="text" id="TextBox1"> </input>
then, I see the text box.
But it is not useful when I am trying to build a page using the web controls.
Why is it none of my web controls are visible?.
Anyone know what is triggering this kind of behavior?
help please...... :(
..."and the Visible properties are set to False."

I am assuming you meant that the visible property is NOT set to false...or this is your problem.

Post your html and code...

MajorCats
Here is the code... None of my web controls are visible when loaded in the browser. When I change them to a normal <input> tag, then it displays. It is not useful, when I am trying to develop a web application in the .Net environment. Text box property is set to Tru to begin with and then changed later in the code. see the button_click event handler code. Any help is appreciated.
thanks.

Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As 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 sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "Hello. " & TextBox1.Text & "!"
TextBox1.Visible = False
Button1.Visible = False
End Sub
End Class

<%@. Page Language="vb" AutoEventWireup="false" Codebehind="Hello.aspx.vb" Inherits="Aerosea.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:Label id="Label1" runat="server">Enter a Name:</asp:Label>
<asp:TextBox id="TextBox1" runat="server" Visible="False"></asp:TextBox>
<asp:Button id="Button1" runat="server" Text="Submit" Visible="False"></asp:Button></P>
</form>
</body>
</HTML
Your problem is the visible=false in your tag...

<asp:TextBox id="TextBox1" runat="server" Visible="False"></asp:TextBox
Change this to:

<asp:TextBox id="TextBox1" runat="server" Visible="True"></asp:TextBox
and it will show up.

Basically, your code shows that you are hiding your textbox and button, and if the button were visible and someone clicked it, you are hiding it yet again......

MajorCats
Thank you very much. I totally overlooked the HTML part and thought the problem was in the Code. I changed it, and now it works.
thanks.

text box and SqlDecimal datatypes

Hi all, I have a DAL which takes in a value as shown below ready for my
MSSQL stored procedure.

protected SqlDecimal _annualLeave = SqlDecimal.Null;
public SqlDecimal AnnualLeave
{

get {return _annualLeave;}

set{ _annualLeave = value;}

}

I have a problem where when I try to pass in information from a textbox on a
ASP.NET page OR Winform the *damn* thing gets rounded to an Integer!

I thought I could just go..

((System.Data.SqlDecimal)AnnualLeave.Text)

Where AnnualLeave.Text is the value of my textbox on my form, but I received
"Cannot convert type 'string' to 'System.Data.SqlTypes.SqlDecimal" error
(Which is fair enough)

So, I tried

((System.Data.SqlDecimal)(Convert.ToDecimal(Annual Leave.Text))

but for some reason, this rounds the number to an integer!! e.g. 12.2
becomes 12!!!!!

Can someone please tell me what am I doing wrong here, it's been a long day
:P

Thanks
MarkHi Mark,

just use Convert.ToDecimal(AnnualLeave.Text)

HTH,

"Mark" <mark@.Z-Zvolution.nZt> wrote in message
news:OQXlCD24FHA.2364@.TK2MSFTNGP12.phx.gbl...
> Hi all, I have a DAL which takes in a value as shown below ready for my
> MSSQL stored procedure.
> protected SqlDecimal _annualLeave = SqlDecimal.Null;
> public SqlDecimal AnnualLeave
> {
> get {return _annualLeave;}
> set{ _annualLeave = value;}
> }
> I have a problem where when I try to pass in information from a textbox on
> a
> ASP.NET page OR Winform the *damn* thing gets rounded to an Integer!
> I thought I could just go..
> ((System.Data.SqlDecimal)AnnualLeave.Text)
> Where AnnualLeave.Text is the value of my textbox on my form, but I
> received
> "Cannot convert type 'string' to 'System.Data.SqlTypes.SqlDecimal" error
> (Which is fair enough)
> So, I tried
> ((System.Data.SqlDecimal)(Convert.ToDecimal(Annual Leave.Text))
> but for some reason, this rounds the number to an integer!! e.g. 12.2
> becomes 12!!!!!
> Can someone please tell me what am I doing wrong here, it's been a long
> day
> :P
> Thanks
> Mark
Hi Onin, I was actually doing this originally and still get the same
problem.

Thanks for your advice
Cheers
Mark
"Onin Tayson" <Leon_Tayson@.compaid.com> wrote in message
news:O%23qlxt44FHA.1140@.tk2msftngp13.phx.gbl...
> Hi Mark,
> just use Convert.ToDecimal(AnnualLeave.Text)
> HTH,
> "Mark" <mark@.Z-Zvolution.nZt> wrote in message
> news:OQXlCD24FHA.2364@.TK2MSFTNGP12.phx.gbl...
> > Hi all, I have a DAL which takes in a value as shown below ready for my
> > MSSQL stored procedure.
> > protected SqlDecimal _annualLeave = SqlDecimal.Null;
> > public SqlDecimal AnnualLeave
> > {
> > get {return _annualLeave;}
> > set{ _annualLeave = value;}
> > }
> > I have a problem where when I try to pass in information from a textbox
on
> > a
> > ASP.NET page OR Winform the *damn* thing gets rounded to an Integer!
> > I thought I could just go..
> > ((System.Data.SqlDecimal)AnnualLeave.Text)
> > Where AnnualLeave.Text is the value of my textbox on my form, but I
> > received
> > "Cannot convert type 'string' to 'System.Data.SqlTypes.SqlDecimal" error
> > (Which is fair enough)
> > So, I tried
> > ((System.Data.SqlDecimal)(Convert.ToDecimal(Annual Leave.Text))
> > but for some reason, this rounds the number to an integer!! e.g. 12.2
> > becomes 12!!!!!
> > Can someone please tell me what am I doing wrong here, it's been a long
> > day
> > :P
> > Thanks
> > Mark

text box and SqlDecimal datatypes

Hi all, I have a DAL which takes in a value as shown below ready for my
MSSQL stored procedure.
protected SqlDecimal _annualLeave = SqlDecimal.Null;
public SqlDecimal AnnualLeave
{
get {return _annualLeave;}
set{ _annualLeave = value;}
}
I have a problem where when I try to pass in information from a textbox on a
ASP.NET page OR Winform the *damn* thing gets rounded to an Integer!
I thought I could just go..
((System.Data.SqlDecimal)AnnualLeave.Text)
Where AnnualLeave.Text is the value of my textbox on my form, but I received
"Cannot convert type 'string' to 'System.Data.SqlTypes.SqlDecimal" error
(Which is fair enough)
So, I tried
((System.Data.SqlDecimal)(Convert.ToDecimal(AnnualLeave.Text))
but for some reason, this rounds the number to an integer!! e.g. 12.2
becomes 12!!!!!
Can someone please tell me what am I doing wrong here, it's been a long day
:P
Thanks
MarkHi Mark,
just use Convert.ToDecimal(AnnualLeave.Text)
HTH,
"Mark" <mark@.Z-Zvolution.nZt> wrote in message
news:OQXlCD24FHA.2364@.TK2MSFTNGP12.phx.gbl...
> Hi all, I have a DAL which takes in a value as shown below ready for my
> MSSQL stored procedure.
> protected SqlDecimal _annualLeave = SqlDecimal.Null;
> public SqlDecimal AnnualLeave
> {
> get {return _annualLeave;}
> set{ _annualLeave = value;}
> }
> I have a problem where when I try to pass in information from a textbox on
> a
> ASP.NET page OR Winform the *damn* thing gets rounded to an Integer!
> I thought I could just go..
> ((System.Data.SqlDecimal)AnnualLeave.Text)
> Where AnnualLeave.Text is the value of my textbox on my form, but I
> received
> "Cannot convert type 'string' to 'System.Data.SqlTypes.SqlDecimal" error
> (Which is fair enough)
> So, I tried
> ((System.Data.SqlDecimal)(Convert.ToDecimal(AnnualLeave.Text))
> but for some reason, this rounds the number to an integer!! e.g. 12.2
> becomes 12!!!!!
> Can someone please tell me what am I doing wrong here, it's been a long
> day
> :P
> Thanks
> Mark
>
Hi Onin, I was actually doing this originally and still get the same
problem.
Thanks for your advice
Cheers
Mark
"Onin Tayson" <Leon_Tayson@.compaid.com> wrote in message
news:O%23qlxt44FHA.1140@.tk2msftngp13.phx.gbl...
> Hi Mark,
> just use Convert.ToDecimal(AnnualLeave.Text)
> HTH,
> "Mark" <mark@.Z-Zvolution.nZt> wrote in message
> news:OQXlCD24FHA.2364@.TK2MSFTNGP12.phx.gbl...
on
>

Text Box Background Yellow at Runtime?

Folks,

I have a few text boxes that the backgrounds are set to white and appear white in the Visual Studio development widow. At runtime they appear as a brownish yellow.

What gives?

SethYou're viewing them on a Windows XP system.

Jeff
You might want to check this out:


Yellow textboxes

text box commands...i think

ok, so i have a textbox and 5 buttons, 4 list different things, and one is the search button...

no when i click enter, and i have text in my tetbox, the page loads, but doesnt do anything, yet when i click search the search function runs..

how do i make it so when a user hits enter on there text box, it runs that function...

Thanks, JustinPlace a simple html textbox in your form, make it hidden.

<input type="text" style="display: none;">

This way, pressing enter should submit the form.
but i dont use <form method="post" action="blabla">

Thanks, Justin
You have to have a form on your page if you're going to make the page work.

Text Box cocatenating instead of adding

When I run this line of code, I'm getting 444 instead of 12:
lblWkTotal1.text = lblSatTotal.text + lblSunTotal.text + lblMonTotal.text + lblTueTotal.text + lblWedTotal.text + lblThuTotal.text + lblFriTotal.text
If I run this line of code, I'm getting this error message: Cast from string "" to type 'Decimal' is not valid.
lblWkTotal1.text = CDec(lblSatTotal.text) + CDec(lblSunTotal.text) + CDec(lblMonTotal.text) + CDec(lblTueTotal.text) + CDec(lblWedTotal.text) + CDec(lblThuTotal.text) + CDec(lblFriTotal.text)
Any ideas how to correct the problem.
Thanks

Try changing from cDec to cDbl


Hi

Try usingCInt(TxtboxName.text).


Thanks David
When I change it to CDbl the followuing messages are generated:
[FormatException: Input string was not in a correct format.]
[InvalidCastException: Cast from string "" to type 'Double' is not valid.]
Any ideas where to go from here?
Franco

David
Changing to CDbl works OK if I first set the default text to 0.
Thanks for the suggestion.
Franco

Try forcing the result to a string
textBox.Text = CStr(Cint(blah) + CInt(Blah))
or
Dim i as Int32
i = CInt(Blah) + ...
textBox.Text = i.ToString()

Text Box Control MaxLenght Property Is Not Working

Hi All,

I have developed one web application.
In that I used aspnet web textBox control.
I have set maxlength property for that text box 300 and TextMode property as
multiline .

When i typed more than 3 or 4 line each line contains 30 to 40 characters,
If i clicked button for passing textbox value, that time my web page is not
responsding (no action taken).

The same page without refereshing if i delete some characters from my
textbox.
It is working.

Can someone help me for this?

--
Regards,
DhanaDhana,

What browser are you using?

"Dhana" <dhana@.celtycs-consulting.com> wrote in message
news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi All,
> I have developed one web application.
> In that I used aspnet web textBox control.
> I have set maxlength property for that text box 300 and TextMode property
> as multiline .
> When i typed more than 3 or 4 line each line contains 30 to 40 characters,
> If i clicked button for passing textbox value, that time my web page is
> not responsding (no action taken).
> The same page without refereshing if i delete some characters from my
> textbox.
> It is working.
> Can someone help me for this?
> --
> Regards,
> Dhana
A TextBox in MultiLine mode is rendered as a TextArea HTML control. TextArea
as opposed to an Imput control does not have a maxlength property. It will
be ignored in the TextBox.

There are some 3rd party controls and projects out there that attempt to
control length with javascript for a multiline textbox. I haven't used any
of them so can't comment.

--

Andrew Robinson
www.binaryocean.com
www.bellinghamdotnet.org

"Dhana" <dhana@.celtycs-consulting.com> wrote in message
news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi All,
> I have developed one web application.
> In that I used aspnet web textBox control.
> I have set maxlength property for that text box 300 and TextMode property
> as multiline .
> When i typed more than 3 or 4 line each line contains 30 to 40 characters,
> If i clicked button for passing textbox value, that time my web page is
> not responsding (no action taken).
> The same page without refereshing if i delete some characters from my
> textbox.
> It is working.
> Can someone help me for this?
> --
> Regards,
> Dhana
Ah yeah...

Try using a javscript function like:

function limitTextarea(textarea, maxlength) {
if (textarea.value.length > maxlength)
textarea.value = textarea.value.substring(0, maxlength);
}

and set the onchange attribute (either programatically with
textbox.attribute.add() or declaratively) on the textbox to call the
function.

"Andrew Robinson" <nemoby@.nospam.nospam> wrote in message
news:%23FQJ$5hDGHA.3820@.TK2MSFTNGP10.phx.gbl...
>A TextBox in MultiLine mode is rendered as a TextArea HTML control.
>TextArea as opposed to an Imput control does not have a maxlength property.
>It will be ignored in the TextBox.
> There are some 3rd party controls and projects out there that attempt to
> control length with javascript for a multiline textbox. I haven't used any
> of them so can't comment.
> --
> Andrew Robinson
> www.binaryocean.com
> www.bellinghamdotnet.org
>
> "Dhana" <dhana@.celtycs-consulting.com> wrote in message
> news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
>>
>> Hi All,
>>
>> I have developed one web application.
>> In that I used aspnet web textBox control.
>> I have set maxlength property for that text box 300 and TextMode property
>> as multiline .
>>
>> When i typed more than 3 or 4 line each line contains 30 to 40
>> characters,
>> If i clicked button for passing textbox value, that time my web page is
>> not responsding (no action taken).
>>
>> The same page without refereshing if i delete some characters from my
>> textbox.
>> It is working.
>>
>> Can someone help me for this?
>>
>> --
>> Regards,
>> Dhana
>>
>>
>>

Text Box Control MaxLenght Property Is Not Working

Hi All,
I have developed one web application.
In that I used aspnet web textBox control.
I have set maxlength property for that text box 300 and TextMode property as
multiline .
When i typed more than 3 or 4 line each line contains 30 to 40 characters,
If i clicked button for passing textbox value, that time my web page is not
responsding (no action taken).
The same page without refereshing if i delete some characters from my
textbox.
It is working.
Can someone help me for this?
Regards,
DhanaDhana,
What browser are you using?
"Dhana" <dhana@.celtycs-consulting.com> wrote in message
news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi All,
> I have developed one web application.
> In that I used aspnet web textBox control.
> I have set maxlength property for that text box 300 and TextMode property
> as multiline .
> When i typed more than 3 or 4 line each line contains 30 to 40 characters,
> If i clicked button for passing textbox value, that time my web page is
> not responsding (no action taken).
> The same page without refereshing if i delete some characters from my
> textbox.
> It is working.
> Can someone help me for this?
> --
> Regards,
> Dhana
>
>
A TextBox in MultiLine mode is rendered as a TextArea HTML control. TextArea
as opposed to an Imput control does not have a maxlength property. It will
be ignored in the TextBox.
There are some 3rd party controls and projects out there that attempt to
control length with javascript for a multiline textbox. I haven't used any
of them so can't comment.
Andrew Robinson
www.binaryocean.com
www.bellinghamdotnet.org
"Dhana" <dhana@.celtycs-consulting.com> wrote in message
news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi All,
> I have developed one web application.
> In that I used aspnet web textBox control.
> I have set maxlength property for that text box 300 and TextMode property
> as multiline .
> When i typed more than 3 or 4 line each line contains 30 to 40 characters,
> If i clicked button for passing textbox value, that time my web page is
> not responsding (no action taken).
> The same page without refereshing if i delete some characters from my
> textbox.
> It is working.
> Can someone help me for this?
> --
> Regards,
> Dhana
>
>
Ah yeah...
Try using a javscript function like:
function limitTextarea(textarea, maxlength) {
if (textarea.value.length > maxlength)
textarea.value = textarea.value.substring(0, maxlength);
}
and set the onchange attribute (either programatically with
textbox.attribute.add() or declaratively) on the textbox to call the
function.
"Andrew Robinson" <nemoby@.nospam.nospam> wrote in message
news:%23FQJ$5hDGHA.3820@.TK2MSFTNGP10.phx.gbl...
>A TextBox in MultiLine mode is rendered as a TextArea HTML control.
>TextArea as opposed to an Imput control does not have a maxlength property.
>It will be ignored in the TextBox.
> There are some 3rd party controls and projects out there that attempt to
> control length with javascript for a multiline textbox. I haven't used any
> of them so can't comment.
> --
> Andrew Robinson
> www.binaryocean.com
> www.bellinghamdotnet.org
>
> "Dhana" <dhana@.celtycs-consulting.com> wrote in message
> news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
>

text box cursor position on entry

Hi I want the cursor to align left when someone clicks in textbox.

textbox has maxlength of 7 when user clicks in text box

the cursor is at position 2 so they cant enter all 7 digits of number

without clicking home and reentering number.

It sounds to me like the textbox has some default text in it already. Otherwise, it would be at the left when they click in. Post your code so we can take a look.
As, suggested please check the Text property. By default when you click inside the TextBox is should align to the left at position "0".

add this in page_load...

sub page_load(byval sender as object, byval e as system.eventargs) handles page.load

txt1.text=""

end sub

cheers

moredotnet


thanks for the replies, I have put txtbox.text="" in page load will see what happens.

please use me.load instead of page.load

cheers

moredotnet


How I CAn Change the Cursor Color or Size InHTML TextBox

Thanks


Hi,

call a java script function onfocus, then set the value of text box to null and then call focus function on that control.

hope this would solve your problem


Unfortunately this not solve my problrm

When textbox.value=null ;

the textbox value be "null"


I wanna to write a dataSet as XML File

I use dataset.WriteXML("Filename"); Method

But if ther are an empty cell it will not Writen

Pls. Help Me;


Hi ,

I couldn't get you complete requirement. Can you try like this.

First check whether your data set contain rows are not . If it contains then write to xml file using

ds.WriteXML("filename.xml")

Text box Display

I don't understand the Display setting for controls such as text boxes.
I have a text box a button next to it, and then a submit button below
everything so that when the 1st button is pressed, a calendar appears
underneath it.

Becasue the submit button is below all the user input stuff, I want to
make it so that the calendar and the submit buttons are given set
positions on the screen, so that whenever I press the 1st button, my
submit button doesn't get pushed down the screen to make way for the
calendar.

I would've thought Display="Static" would do this, but I get the same
result as using Display="Dynamic". Can anybody help me out with this?

Any help would be really appreciated.

Thanks,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!You need to use absolute display but make sure the parent elements are all
setup - positioning elements in pixel offsets is not a very good thing to
do. Static is meant for something else and IE does not even support it.

Jerry

"Mike P" <mrp@.telcoelectronics.co.uk> wrote in message
news:OVZiJ#UmDHA.2772@.TK2MSFTNGP10.phx.gbl...
> I don't understand the Display setting for controls such as text boxes.
> I have a text box a button next to it, and then a submit button below
> everything so that when the 1st button is pressed, a calendar appears
> underneath it.
> Becasue the submit button is below all the user input stuff, I want to
> make it so that the calendar and the submit buttons are given set
> positions on the screen, so that whenever I press the 1st button, my
> submit button doesn't get pushed down the screen to make way for the
> calendar.
> I would've thought Display="Static" would do this, but I get the same
> result as using Display="Dynamic". Can anybody help me out with this?
>
> Any help would be really appreciated.
>
> Thanks,
> Mike
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!