|
HI
I have created user control that containing one label control and one button control without any code written in code behind.if i use this control in asp.net page using <object> tag its working fine. if i write any code for button click event its not working
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
You don't need the object tag. Just drop the user control on the page and you'll end up with something like this.
<%@ Register Src="UserControls/FooBar.ascx" TagName="FooBar" TagPrefix="uc1" %><br />
<br />
<uc1:FooBar id="FooBar1" runat="server"></uc1:FooBar>
only two letters away from being an asset
|
|
|
|
|
Ya but i created my user control through WebContolLibrary. so i created dll files through windows application with webControlLibrary.Because i want to use some windows form controls on my web page..please give me some idea related with this
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
|
Hi everyone,
I have the follwing problem:
The web page/site that I am creating in ASP.NET has a button control or image button control which should display the calendar control. I am trying to avoid the postback from being triggered every time I press the button/image button.
So far I have learned that one of options is to declare the button as the HTML button, not the ASP.NET server executed button.
After creating the button a portion of code was inserted into the HTML code which declares and defines the OnClick() function for the HTML button. The code is marked as javascript code.
Now my problem is how to interact with other ASP.NET controls, i.e. how to populate the textbox control with some value/text? The thing I do not know is how to reference the ASP.NET controls from within the javascript? Is it possible to do so?
The code that was generated for the HTML Button:
<br />
<script language="javascript" type="text/javascript"><br />
<br />
<br />
Function Button1_onclick()<br />
{<br />
<br />
}<br />
<br />
<br />
</script><br />
Once more my question is how, if possible, to interact with other ASP.NET controls on my web page? In particular, I wish to add some text (date) to a TextBox without causing the postback event, using the HTML button.
Thanks a lot!
|
|
|
|
|
HI
Yes u can use by document.GetElementById('txt_Id').value for asp.net textbox control.
Pathan
|
|
|
|
|
Hi,
I tried but something's wrong?!
The IntelliSense does not show the 'value' data member?!
Do you have an idea.
Foe example, can I control the visibility of a Calendar control. Usually I would write something like this in a C#:
<br />
CalendarControl1.Visible=true;<br />
<br />
or...<br />
<br />
txtDate.Text = "No date set!";<br />
Thanks!
|
|
|
|
|
nermsk wrote: Usually I would write something like this in a C#:
That's the problem, it's not C#. You need to use the properties exposed via JavaScript, i.e. TextBox.innerText or Calendar.style.display = 'block'
only two letters away from being an asset
|
|
|
|
|
why don't u use rjs calendar?
it's the best one i've seen till now
Best Regards
3ala2
|
|
|
|
|
i am making a search code in my website and i've got this error after clicking on search button,although it sometimes work
|
|
|
|
|
Going to a page that doesn't exist...
|
|
|
|
|
Thanx for ur reply
i had this error when i copied the code of search to another project
but i the old project the search worked correct,then without nay change of code the error of (500) Internal Server Error occurs.
i'm working on windows xp version.Is this the cause or what?
thnx again
Ola
|
|
|
|
|
Without seing the code its very difficult for any one to guess what happened
Do one thing debug the prject and see the query or the path you are searching exist or not
|
|
|
|
|
Hi all,
I have 1000 employees to load in a webcontrol treeview and display in a web application.Loading takes just 2 seconds , but displaying time takes another 5 secs. How to reduce this timing? Please help
Senthil
|
|
|
|
|
i also have same problem.searching for soln.
|
|
|
|
|
treeview are very slow. I have not yet found the solution
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
hi,
I have a problem with Popup window in IE7 when ever i create a popup window and i try to close tat popup window its creating a new popup window. with same url. when i clik on this second popup windwo then its closing.
code:
Default.aspx
<script language="javascript" >
function OpenAnotherWindow()
{ var name = document.getElementById("txtName").name;
WindowName="test";
var left, top;
left = (window.screen.availWidth - 400)/2;
top = (window.screen.availheight - 250)/2;
settings= "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, top="+ top +", left="+left+", height=250,width=400";
var id = window.showModalDialog('DialogPage.aspx?name='+ document.form1.txtName.value,WindowName, settings);
document.getElementById("txtName").value=id;
}
</script>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnOpenWindow" runat="server" Text="Open Window" />
<input id="txtName" type="text" /></div>
</form>
</body>
default.aspx.cs
page_load
btnOpenWindow.Attributes.Add("onclick", "return OpenAnotherWindow()");
dialogpage.aspx
<script language="javascript">
function CloseThisWindow()
{
var myName = "Popup";
var o = new Object();
o.orglevid = "1";
o.orgname = "test";
window.returnValue=o.orgname;
window.close();
return true;
}
</script>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnCloseWindow" runat="server" Text="Close Window" OnClick="btnCloseWindow_Click" />
</div>
</form>
please help me out
not this issue is in IE 7 only in IE 6 its working fine
sri
|
|
|
|
|
The reason for the second window is that you are posting the form from the dialog. As you can not post a form to a dialog window, it will be posted to a new window.
Return false from the CloseThisWindow function, so that the form is not posted.
If you don't want the form on the main page to be posted immediately after the dialog closes, you should return false from the OpenAnotherWindow function also.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Thanx for ur response, but i traied all these ways and still my application is acting like tat only. is there any other way to this problem. pls inform me
thanx
sri
|
|
|
|
|
sri_con3 wrote: Thanx for ur response, but i traied all these ways and still my application is acting like tat only.
Then you probably did something wrong...
sri_con3 wrote: is there any other way to this problem.
Yes, if you don't want the form submitted you can avoid using a submit button (which is what the asp:Button control produces). Use an input tag with type="button" instead.
---
b { font-weight: normal; }
|
|
|
|
|
hi, thanx for your response
I checked every thing in my code. It is working fine in IE6 but when it comes to IE7 its givin theis problem. Is there any alternative for it. i have to use tat asp:button control not the input control
sri
|
|
|
|
|
As I explained before, return false from the event, and the form will not get posted.
---
b { font-weight: normal; }
|
|
|
|
|
add below code
<br />
<HEAD><br />
<meta http-equiv="pragma" content="no-cache"><br />
<base target="_self"><br />
</HEAD><br />
regards
ravi
|
|
|
|
|
Hi Ravi,
Thanx for ur response.i traid those tags.even then also its opening a new popup window but the difference is parent form is getting the focus.
i am sending the popup window's code (runtime)
Note: in form tag action attribute is automatically assigning
aaa
<!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><title>
Dialog Page
</title>
<script language="javascript">
function CloseThisWindow()
{
var myName = "Popup";
var o = new Object();
o.orglevid = "1";
o.orgname = "test";
window.returnValue=o.orgname;
window.close();
}
</script>
</head>
<body onunload="return CloseThisWindow()">
<form name="form1" method="post" action="DialogPage.aspx?name=aaa" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTQ2OTkzNDMyMQ9kFgICAw9kFgICAQ8PZBYCHgdvbmNsaWNrBRFDbG9zZVRoaXNXaW5kb3coKWRkE3PwyvEwHPyG1owfw5owH52JoAI=" />
</div>
<div>
<input type="submit" name="btnCloseWindow" value="Close Window" onclick="CloseThisWindow();" id="btnCloseWindow" />
</div>
<div>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgKcvcyRBwLT6dHJCjZ2UnucyVCJsYvBd03DmA/bJ6Z3" />
</div></form>
</body>
</html>
sri
|
|
|
|
|
Hi ALl
i have generated one datagrid at runtime.I want to add scrollbar in that datagrid at runtime also
How is it possible?
Thanks
monika
|
|
|
|