|
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.
|
|
|
|
|
document.getElementById('') works fine if <form></form> are present.
Now my requirement is that I inherit any content template on webform. Due to this, <form></form> is not present now.
I drag drop HTML button (<input type="button") and asp text box(asp:textbox).
Now in java script code, document.getElementById(''); does not work, it is not recognsising asp.net textbox because both HTML button and asp text box are not present under <form>.
So how to achieve in that case.
|
|
|
|
|
Why do you need to not have a form ? Do asp: controls work in that case at all ?
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.
|
|
|
|
|
|
There is HTML button (<input type=reset>) on screen.
There is text box (asp:textbox) on screen.
----------------------------------
I have written the below code.
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
Response.Write("hi");
}
Autopost back of text box=false.
Whatever I put in textbox, reset clears it.
Now suppose I make Autopost back of text box=true.
Say enter any text in text box. Now click on say screen. post back will take place, page load will occur. Now I click on "reset", text does not get cleared. WHy?
|
|
|
|
|
amittinku wrote: Whatever I put in textbox, reset clears it.
Because you are not in a form, you have no viewstate, I thought.
amittinku wrote: Now click on say screen. post back will take place, page load will occur. Now I click on "reset", text does not get cleared. WHy?
Removing the form means that the behaviour of the controls is going to be unpredicatable. Viewstate works on post variables, they get posted in the context of a form. No form, no viewstate. I guess autopostback creates a post that does persist the data.
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.
|
|
|
|
|
I'm upgrading a company's website. They are using multiple levels of IFrames to layout their application. I'm able to remove some of the outermost frames and embed the logic into the pages themselves, but some of the child content (displayed in frames) would be rather difficult to merge with the parent frame. Any ideas on a good and simple way to accomplish this? I'm considering putting the child page into a component and hosting the component on the parent page. Not sure if that's the best way to go.
John
http://tagyurit.com
r
|
|
|
|
|
Anything that appears more than once, needs to be a control. Anything that is on every page, or most pages, should be in a master page.
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.
|
|
|
|
|
Thanks for the reply, but that's not quite the answer I was looking for. My 'child' pages have a 1:1 relationship with the 'parent' page. So, while it may be a good idea to host the child page as a control, it's not for the benefit of code reuse. Master pages won't solve my problem; either. Again - the 1:1 relationship between parent and child.
Thanks again for the reply.
john
http://tagyurit.com
r
|
|
|
|
|
OK, well, you can break pages up into components if they are insanely compicated, but the resultant plumbing code could well negate any advantage you may get. Breaking your code into regions may help readability if there's a lot of code.
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.
|
|
|
|
|
I wanna embed an audio player.....im retrieving location of that song file from querystring which means i can't embed that player in my code behind...i have to embed that player in event handler page.....
image1.AlternateText = Request.QueryString["art"];
image1.ImageUrl = Request.QueryString["imgg"];
label2.Text = image1.AlternateText;
Response.Write("<OBJECT width=312px height=248px clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 VIEWASTEXT&gt;");
Response.Write("<PARAM name=autoStart value=False>");
Response.Write("<PARAM name=URL value='" + Request.QueryString["u"] + "'>");
but the problem is that i used this page under master page...and the content of master page and other code behind contents are not visible only i see this dynamically generated player because code behind content is in content placeholder of master....is there any way that i can embed this player in my code behind but give the value of it's url from querystring....
|
|
|
|