|
om pr wrote: One, how can i include a .js and .css file in an .ascx page? Are we allowed to use tag, if yes then can I just include them as usual by using tag?
Yes you can do that. Or you can include them in the page where you will use them.
om pr wrote: Two, I have an HTML(not aspx) page which i want to convert to a user control. I have javascript functions being called on the "load" and "onmousedown" event for the body of the HTML page. But since user contriol do not have body so how do I implement it...?
HTML you can convert to user controls. Since it doesn't have a body tag, you should call OnLoad events inside the page where you use them.
|
|
|
|
|
Hi,
i created one user control, in that control i called function. But it is not working when i used that user control in my form.
But the same coding can be working in pages.
Can any one help me?
In my user control i created one table like this,
I write the code in server side as follows,
HtmlTableRow htr,htr1;
HtmlTableCell htc;
htr = new HtmlTableRow();
htc = new HtmlTableCell();
htc.InnerHtml = "Sutheesh Visible";
htr.Cells.Add(htc);
SampForum.Controls.Add(htr);
htr1 = new HtmlTableRow();
htr1.ID = "Hello";
htc = new HtmlTableCell();
htc.InnerHtml = "Sutheesh Invisible";
htr1.Cells.Add(htc);
htr1.Style.Add("display", "none");
htr.Attributes.Add("onClick", "ShowHide('" + htr1.ClientID+ "')");
Ftable.Controls.Add(htr1);
JavaScript:
function ShowHide(cell)
{
alert(cell);
if(document.getElementById(cell).style.display=="none")
document.getElementById(cell).style.display="inline";
else
document.getElementById(cell).style.display="none";
}
|
|
|
|
|
Why isn't it working? You haven't stated what the problem is.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks for ur reply friend.
The page cannt find document.getElementById(cell), because it (cell) is created in usercontrol.
|
|
|
|
|
Member 4755319 wrote: because it (cell) is created in usercontrol.
Have you checked the page source ? Verify the alert is giving the same name which is there in the page source.
|
|
|
|
|
Thanks Navaneeth, Finally i got the answer by ur clue, i saw the page source it was different from the id. It includes usercontrolname_id.
Now my user control is working fine.... Thanks alot..
|
|
|
|
|
Hi all,
iam generating a report and binding it to a grid view. This grid contain too many reports. When iam using window.print the whole report is printed on 1 page with a very very tiny font. while i want the report to go on second and third page etc... if it has too many columns in it.
thanks
|
|
|
|
|
Hi dears,
I have a website with ASP.NET 2.0
in my website each user has an album that can upload her photos on it.
User should be able to delete images(my website i s hosted on my dedicated server).But its impossible. I did grant delete access for aspnet user to PhotoAlbum directory on server, but I can`t delete any file.
the aspnet user in server is member of users group not administrators group.
I want to know how can I fix this problem ?!
thx for your help,
www.behzadi.net
|
|
|
|
|
Try impersonating user before you delete and undo the impersonation after you are done. Check this[^] MSDN article for getting an idea on this.
|
|
|
|
|
i have a girdview inside a panel, i have include css
.TblHeaderFixed { position:relative; }
in GridView i have inclued as shown
HeaderStyle-CssClass="TblHeaderFixed"
i find the header fixed but it creeps out of the div or panel in which the grid is placed. The DataRow of the grid however remains within the div. but only the header is out. Kindly help...
ranji varghese
|
|
|
|
|
hi friends
this is my code for check the system LAN connected or not
Dim server As String = "207.46.134.222"
Try
Dim hostInfo As IPHostEntry = Dns.GetHostByAddress(server)
Catch ex As Exception
Response.Write("OFF, host turned off")
End Try
here i connect the 20 machines through LAN.here i give all the machine IP in code behind(same as above code)
if i run the application ,the application performance is poor display the LAN details 5 min
how can i improve my applicaton peformance
Regards
saravnan
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
Plz help....
While i'm clicking the linkbutton i'll get N=A or N=D in Url box...
Thanks in advance
|
|
|
|
|
I want to display a message box with Ok and Cancel buttons in Asp.Net using C#. Can anyone help me in this?
Thanks in advance..
Thanks & Regards,
Radha
|
|
|
|
|
You ought to use Javascript to achieve this.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Use JS, confirm method for this.
|
|
|
|
|
Use , JavaScript
Alert, Confirm
|
|
|
|
|
I have tried the following but its nmot geting displayed..
Here is my code..
protected void btnSubmit_Click(object sender, EventArgs e)
{
...
CheckDate();
...
}
protected void CheckDate()
{
...
if (id > 0){ ClientScript.RegisterClientScriptBlock( typeof(Page), "Script", "alert('Selected Date have already Data.. Are you sure you want to continue for the same date? ');", true); }
else
{ ... }
}
Did i misss anything here? Can u plaese help me?
Thanks in Advance..
Thanks & Regards,
Radha
|
|
|
|
|
Radha27 wrote: if (id > 0){ ClientScript.RegisterClientScriptBlock( typeof(Page), "Script", "alert('Selected Date have already Data.. Are you sure you want to continue for the same date? ');", true); }
This won't help you. Your alert will be displayed after page processes all data. Do this in other page and show you message on the page.
|
|
|
|
|
Sorry navaneeth, can u explain me how can i do this?.. if u dont mind
Thanks in Advance
Thanks & Regards,
Radha
|
|
|
|
|
Radha27 wrote: if (id > 0){ ClientScript.RegisterClientScriptBlock( typeof(Page), "Script", "alert('Selected Date have already Data.. Are you sure you want to continue for the same date? ');", true); }
The above code won't work because, JS will emitted to the response and displayed to the page after all processing done by ASP.NET. It won't wait until you press the Ok button in the alert. So this method is no use. Instead of this, you can redirect to another page where a message will be displayed like "Selected date have already data. Are you sure to continue". Put two buttons, "Continue" and "Cancel". Inside "Continue" button write your logic for continuing the operation.
Hope it clear now.
|
|
|
|
|
Ok, Thank u, I got it.. but is there any other possibility to solve this?
Thanks & Regards,
Radha
|
|
|
|
|
You can display this in same page also. Put those two buttons inside a panel which is set as hidden when page loads. When your condition satisfies, make this panel visible which will show message and buttons. This help you to avoid transferring data from this page to the message page.
|
|
|
|
|
Thank You, I will try.
Thanks & Regards,
Radha
|
|
|
|
|
hi all ,
I want have one confirmation box with Yes and No button with default focus is on No.
1.I have tried with Windows.confirm(), but the focus cannot be changed default to NO it seems.
2. I cannot use MessageBox because it is c# website and we use publish code in which messagebox dont work.
I need this very very urgently plssss help
Thanks in advance
Sampad
|
|
|
|
|
Hi friends,
I there anyway to stop the popout calendae from closing when i click next/prev month? Following is my code(taken from ASP.NET 2.0 unleashed):
==========================================================================
]]>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void calEventDate_SelectionChanged(object sender, EventArgs e)
{
txtEventDate.Text = calEventDate.SelectedDate.ToString("d");
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
lblResult.Text = "You picked: " + txtEventDate.Text;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<script type="text/javascript">
function displayCalendar()
{
var datePicker = document.getElementById('datePicker');
datePicker.style.display = 'block';
}
</script>
<style type="text/css">
#datePicker
{
display:none;
position:absolute;
border:solid 2px black;
background-color:white;
}
.content
{
width:400px;
background-color:white;
margin:auto;
padding:10px;
}
html
{
background-color:silver;
}
</style>
<title>Calendar with JavaScript</title>
</head>
<body>
<form id="form1" runat="server">
<div class="content">
<asp:Label
id="lblEventDate"
Text="Event Date:"
AssociatedControlID="txtEventDate"
Runat="server" />
<asp:TextBox
id="txtEventDate"
Runat="server" />
<img src="Calendar.gif" onclick="displayCalendar()" id="IMG1" />
<div id="datePicker">
<asp:Calendar
id="calEventDate"
OnSelectionChanged="calEventDate_SelectionChanged"
Runat="server" />
</div>
<br />
<asp:Button
id="btnSubmit"
Text="Submit"
Runat="server" OnClick="btnSubmit_Click" />
<hr />
<asp:Label
id="lblResult"
Runat="server" />
</div>
</form>
</body>
</html>
==========================================================================
Thanks
lene
|
|
|
|