|
www.diawebster.com[^]
That's my company site. The main page is just default.htm, I believe. It goes there automatically, but it's a HTML page. The top aspx uses javascript to control the bottom frame ( they are named for this purpose ). Any links in the bottom section just work, they all work within the frame they are in.
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.
|
|
|
|
|
Hi
I have a repeater control and a textbox in itemtemplate of repeater control. Now I am creating multiple textbox dynamically and bind to the repeater . so i m getting multiple textbox in repeater at runtime.
I need to set the focus on pressing on space bar key on these textbox. actully my requirement is that every textbox accept only one word.
Pls suggest me.
Regards
Vikas
sdsds
|
|
|
|
|
You need to write some javascript to enforce both of these rules.
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.
|
|
|
|
|
Hi
Please send any helpful link for these.
Please suggest me.
Regards
Vikas
sdsds
|
|
|
|
|
Member 2925225 wrote: ctully my requirement is that every textbox accept only one word.
SRY
If It Helps Click It as Answer
|
|
|
|
|
No
this is not the solution.
One word menas it can accept multiple characters.
when I press space bar in textbox, focus set to another textbox .
I have resolve this if textboxes are outside the Repeater control.
But If textboxes are Inside repeater control and are generating at runtime.
how i get the id of the textboxes created at runtime ?
and how it set the focus in textboxes in space bar key press?
Thanks
vikas
sdsds
|
|
|
|
|
Member 2925225 wrote: how i get the id of the textboxes created at runtime ?
ClientID property
Member 2925225 wrote: and how it set the focus in textboxes in space bar key press?
you can catch events in javascript and call the focus() method of a control you look up with document.getElementById
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.
|
|
|
|
|
Hi
Please send any help ful link to resolve this.
Thanks
Vikas
sdsds
|
|
|
|
|
Sorry Chris, I might be asking similar type question earlier also but this is final summary.
Suppose we have designed a master page. Say we keep nothing in it.
We inherit it in a webform.
Now I have observed the following. Please confirm,reply also:
1. <form> /<form> is not present.
HTML Reset button works fine.
Document.getelementbyid-> does not work because form is not present.
2. In web form where i have inherited master page, I keep one html reset button and standard asp text box.
If autopostback of textbox=true then
whatever we enter in textbox and click on reset, page load occurs.It will retain the values. Now value from text box will not be cleared after clicking on Reset. Because reset sets it back to inital value (that we got after page load).
If autopostback of textbox=false then
whatever we enter in textbox and click on reset, value will be cleared.
3. In my requirement i have inherited master page in web form as mentioned above.
It's requirement to keep autopost back of textbox=True.
Now reset will never clear the values of text box.
In that case, if i use simple HTM button (not reset) and try to write the following code, it does not work because <form> is not present. So document will not be identified.
function ResetForm(){
var elems = document.forms[0].elements;
for(var i=0;i<elems.length;i++){
elems[i].value = "";
}
}
So in webform (using master page), how to clear the values of text box on clicking of button.
Note: document will not work because <form> is not present.
autopost back will be true for text box because we have to trigger event TextBox1_TextChanged1 also.
TextBox1_TextChanged1 will not work without autopostback.
So plz tell me solution.
|
|
|
|
|
amittinku wrote: <form> /<form> is not present.
your page is broken if this is true
amittinku wrote: If autopostback of textbox=true then
whatever we enter in textbox and click on reset, page load occurs.It will retain the values. Now value from text box will not be cleared after clicking on Reset. Because reset sets it back to inital value (that we got after page load).
If autopostback of textbox=false then
whatever we enter in textbox and click on reset, value will be cleared.
Because you don't have a form
amittinku wrote: In that case, if i use simple HTM button (not reset) and try to write the following code, it does not work because <form> is not present. So document will not be identified.
Correct
amittinku wrote: So in webform (using master page), how to clear the values of text box on clicking of button.
PUT A FORM ON THE PAGE !!!!
And don't post a new question when your old one is still visible, and you're asking the same thing.
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.
|
|
|
|
|
PUT A FORM ON THE PAGE !!!!
I have inherited master page. Now I will have to paste controls on Content.
Can we still post a form, there is so speciic control as such
|
|
|
|
|
Your master page defines the form, if it's written right. The content pages go inside the form. An ASP.NET page should only have one form on it.
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.
|
|
|
|
|
In Asp .net set the Text Box property EnableViewState="false" then ur prob are solve.........
|
|
|
|
|
Hi To,
I Want to count visitor no of our site and also display it in my site by which user can see his visitor no of site.
for which I have written this code in globle asax in application start event and show it in the master page.
but the value is reset every time.
The code is ..
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Application("visitor") = 1
End Sub
and the code of session_start is..
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Application("visitor") = CType(Application("visitor"), Integer) + 1
End Sub
and
display it in the form load int master page
Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
|
|
|
|
|
Samarjeet Singh@india wrote: Me.Label1.Text = "Visitor No " + Application("visitor").ToString()
Of course you don't call it Label1, right ?
Of course it's reset. EVery time the application is. You need to persist it somewhere for it to never reset, like a text file or a DB.
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.
|
|
|
|
|
Thnks for Reply...
Yes it may be value reset but I am taking application type variable then why it is reset from 100 to 1. just give me some hints. is there any way inwhich we can show it with out store db or file....
|
|
|
|
|
Samarjeet Singh@india wrote: just give me some hints. is there any way inwhich we can show it with out store db or file....
Well, that's what I just told you to do, didn't I ? Which bit are you stuck on ? If you've written a website that is likely to care about a visit count, surely you know how to use a database, or a flat file ?
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.
|
|
|
|
|
This code is for current visitors on site if you implement Session_end event too. If you are trying to count total visitors you must use a database or any kind of data storage
|
|
|
|
|
As Christian said, on application start get that text file/DB to display total number of visitors and on session start get that value,add 1 and save back.
|
|
|
|
|
it's very easy process you may go now this url http://www.amazingcounters.com
And Chose Your Visitor Counter Designed & Copy the code or Add ur Site master page...................
|
|
|
|
|
I have done the crystal report throught Visual Studio IDE as web site. It is working fine. but when i run the same from the site (available in the local machine) it is throwing error as connection failed.
I have not published the web site.
Kindly help
Gan
|
|
|
|
|
Check The Connection String Of the Crystal report
If It Helps Click It as Answer
|
|
|
|
|
Ganesh_061974 wrote: but when i run the same from the site (available in the local machine)
From where ? VS or IIS ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
There is Standard test box on webform i.e. <asp:TextBox>
There is one HTML button on screen i.e. <input id="button1">
on Button1_onclick(), I want to clear the text entered in text box.
When I run it, It is not recognising text box object.
Note:code is in aspx file only, no code in aspx.cs file.
Check the code below, why <input id="button1"> not recognising <asp:TextBox> in java script:
---------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="button_postback.aspx.cs" Inherits="button_postback" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
// <!CDATA[
function Button1_onclick() {
t1.text="";
}
// ]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
&nbsp;
<asp:TextBox ID="t1" runat="server"></asp:TextBox>
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /></div>
</form>
</body>
</html>
|
|
|
|
|
I believe that if you created a textbox called t1, then document.t1 MAY work. I dunno, I always use document.getElementById to look up controls. However, either way, you have not created an element called t1. You may want to buy some books on ASP.NET and research the framework you're using.
ASP.NET generates it's own id based on the server side id you provide. You can use the ClientID property of the control in your code behind to get the right id to pass to your javascript. Either way, you should always read your html by viewing source in the browser as a first step to understanding issues like this.
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.
|
|
|
|