|
Now we are getting somewhere.. You understood my question.
I am a beginner, so you could please tell what kind of code I need and where I have to put it?
I guees it is to be placed under scripts and look a bit like:
Protected Sub ProjektstartdatoTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
::code::
End Sub
Thanks for your help.
|
|
|
|
|
Use The Database query for retriving the data Fron DataBase as a date format
CONVERT (VARCHAR,u.[dob] ,101) AS dob
And Bind the Data to the Textbox in the FormView
Like
<asp:TextBox ID="DateOfBirth" runat="server" Text='<%# Bind("dob") %>'></asp:TextBox>
and in pageload Bind the Source
MrRhodos wrote: I am a beginner
Please try To Read a Good Book For FormView Control
|
|
|
|
|
It was much easier than that, but thanks for your help.
<%# Bind("dob","{0 }") %>
And you are right about the book, it would probably help a lot.
|
|
|
|
|
MrRhodos wrote: And you are right about the book, it would probably help a lot.
But, you get to keep your job either way, so you're not going to bother learning ASP.NET, right ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
MrRhodos wrote: How can I change the date type of a textbox
Plz Can You Explain In Brief..!
|
|
|
|
|
Convert your date to proper format which is understood by sql server.
use
DateTime.Parse
I think it would be better to understand your requirement if you could make more clear sentence.
|
|
|
|
|
I have a validation for the fileupload control in my page, where the user is supposed to upload only text or csv files. I used the following expression:
ValidationExpression="[a-zA-Z\\].*(.txt|.csv|.CSV)$
This works fine. However, the issue is, when the text or csv file starts with digits. How should I include numbers also inside this expression? Do anybody has anyidea? Pls help. I tried many ways, but Iam getting the custom error message, 'File must be txt or csv format'.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
simply modify the validation expresstion to this
ValidationExpression="[a-zA-Z1-9\\].*(.txt|.csv|.CSV)
|
|
|
|
|
Well, why don't you just check the file extension and accept any filename ? What if someone has a csv that happens to not have the right extension ? What if someone has a file called *.csv, but it's not a csv.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Dear All,
I am making an application using ASP.Net and C#. I have a text box where i require only numerics to be entered....
I have used the RegularExpressionValidator. I there any other way, where we can trap the Ascii key of the key pressed and validate this.
Thanks in advance
Sajit 
|
|
|
|
|
You can do this using javascript, but you should still use a validator on the server side, just in case. All JS can be defeated.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Dear Sasidhar,
Thanks for the fast response.
But the msdn link is for a window application. I am sorry, but i am making a web application. Can you throw some light on it.
Sajit
|
|
|
|
|
Again Try Now I modified It
|
|
|
|
|
Dear sashidhar,
where is the link...?? do i follow the same rizwan blog link...
sajit
|
|
|
|
|
<
script language="javascript">
function KeyCheck(e)
{
var KeyID = (window.event) ? event.keyCode : e.which;
if((KeyID >= 65 && KeyID <= 90) || (KeyID >= 97 && KeyID <= 122) || (KeyID >= 33 && KeyID <= 47) ||
(KeyID >= 58 && KeyID <= 64) || (KeyID >= 91 && KeyID <= 96) || (KeyID >= 123 && KeyID <= 126))
{
return false;
}
return true;
}
</
script>
HTML Text Box
<
input type="text" ID="txt_TextBox" onkeypress="return KeyCheck(event);" runat="server" style="width: 28px" />
ASP.Net TextBox
<asp:TextBox ID="txt_ASPTextBox" runat="server" ></asp:TextBox>
Code Behind for Asp.Net TextBox
txt_ASPTextBox.Attributes.Add("onkeypress","return KeyCheck(event);");
I Think This Your Answer..!
If ITs Not Sorry..1
|
|
|
|
|
style="background-color:Gray;" not working in IE
in below code to change iframe background color.
<iframe onblur="CopyDatarichtext1();" style="width: 99%;background-color:Gray;" id="richtext1_x5" border="0"
name="I1" width="100%" height="291" runat="server">
</iframe>
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Iframe loads the entire document inside it. So use iframe.document.body.style.background , instead of this.
Remember to do this after Iframe loads the document inside it.
|
|
|
|
|
hi
how do i load table information into aspxcombobox ?
|
|
|
|
|
zizigolo110 wrote: how do i load table information into aspxcombobox ?
You need to load data into data source from table. Set the Combobox data source and data value properties.
It seems you have joined code project today ! so first of all welcome to Code Project !
Please read forum guide line before ask any question over here.
Thanks ! All the best !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
zizigolo110 wrote: how do i load table information into aspxcombobox ?
As AJ Suggests Try to Extract the data into DataSource.You Add The DataSource By the following Way
DropDown1.DataSource = YourDataSource;
DropDown1.DataTextField = "Name";
DropDown1.DataValueField = "Id";
DropDown1.DataBind();
DropDown1.Items.Insert(0, "Select");
Welcome To Code Project
|
|
|
|
|
hi friends,
am developing a live chat web application using asp.net+ajax+c#.
i have taken multi line text box to display messages. i added some JavaScript to maintain text box scrollbar position at the last message.
here my problem is....if i want to scroll the scroll bar upwards to see previous messages,,,the scroll bar is not going up..it always staying at last message.i cant overcome this problem...
i have taken timer, update panel and 2 text boxes.one textbox to type message and other to display message.i kept timer and multiline textbox(to display messages) in update panel.
please do some favour to me in this issue..thanks in advance.
|
|
|
|
|
sasirekha wrote: i added some JavaScript to maintain text box scrollbar position at the last message.
No Need To add JavaScript For adding Scroll Bars .It Will Generate Automatically.!
Are You Adding the message in the textbox with the New One.If Yes Check the Message is Fully Present or not.
|
|
|
|
|
The issue is with the timer. If you continuously place the data within a timer to a textbox it will automatically go to the bottom of the scroller.
See, If you just paste a text within a textbox, the cursor moves to the bottom of the scroller. So this is your case.
If you need to move the cursor to the top, just after the text is copied. Use this after you set the text to the textbox.
var oTextbox = document.all.item(sTextboxID);
if (oTextbox.createTextRange)
{
var r = (oTextbox.createTextRange());
r.moveStart('character', (0));
r.collapse();
r.select();
}
}
See it it works or not..
|
|
|
|
|
Hi,
I am working with VS.Net 2008 application & am in need to provide some link (for ex: http:www.google.com)to the Images that are shown in the slideshowextender ajax control in asp.net with c#. On the click of the every single image a new window with the corresponding URL(retrieved from the DB) should get open. Kindly help me in getting through this. Waiting for your response. Thank You.
I have pasted the html source code & code behind use , Pls help me...
Design page
This Design page is an user control & iam accessing the GetImage Method from its Parent page, in which i wrote the Code (pasted below)
<asp:Image ID="image1" runat="server" Height="150px" Width="230px" />
<br />
<cc1:SlideShowExtender ID="SlideShowExtender1" runat="server" AutoPlay="true" Loop="true"
SlideShowServiceMethod="GetImage" TargetControlID="image1">
</cc1:SlideShowExtender>
Code behind page
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static AjaxControlToolkit.Slide[] GetImage()
{
string promophotos, promoimages;
SqlDataSource ds = new SqlDataSource();
ds.ConnectionString = ConnectionString.Str_SqlCon_CmInfoline.ToString();
string mySelect;
int count = 0;
mySelect = "select Tooltip,BschoolName,Imageurl,UrlPath from Tbl_InfolinePromoPhotos";
ds.SelectCommand = mySelect;
System.Data.DataView dv = (System.Data.DataView)ds.Select(new DataSourceSelectArguments());
count = dv.Table.Rows.Count;
AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[count];
try
{
for (int i = 0; i < count; i++)
{
promophotos = dv.Table.Rows[i]["Imageurl"].ToString();
string[] photopath = promophotos.Split(',');
promoimages = photopath[1];
slides[i] = new AjaxControlToolkit.Slide(Global.contentUrl + "/Admin/Bschool/PromoPhotos/" + promoimages.TrimStart('.'), dv.Table.Rows[i]["Tooltip"].ToString(), dv.Table.Rows[i]["UrlPath"].ToString());
}
}
catch { }
return (slides);
}
|
|
|
|