|
My application has a online test module, where i generate controls at runtime. As shown in the code block below. I am inserting them in a datatable (one span tag in one row)
I want to bind it to a control (say gridview) and provide paging.
How can i do this? If i bind the datatable to the gridview i am able to see the html tags only but not the controls. I am
<span id="lblQuestion01" class="optQuizup"><br>1) CHSC Question1 (Marks 2)<br><br></span>
<span class="optQuizup"><input id="chkOption00" type="checkbox" name="chkOption00" onclick="uncheckOthers(chkOption00,0,4);" /><label for="chkOption00">vxcv<br></label></span>
<span class="optQuizup"><input id="chkOption01" type="checkbox" name="chkOption01" onclick="uncheckOthers(chkOption01,0,4);" /><label for="chkOption01">cxvcb<br></label></span>
<span class="optQuizup"><input id="chkOption02" type="checkbox" name="chkOption02" onclick="uncheckOthers(chkOption02,0,4);" /><label for="chkOption02">ghfgh<br></label></span>
<span class="optQuizup"><input id="chkOption03" type="checkbox" name="chkOption03" onclick="uncheckOthers(chkOption03,0,4);" /><label for="chkOption03">fbvcb<br></label></span>
<span id="lblQuestion11" class="optQuizup"><br>2) CHSC Question2 (Marks 2)<br><br></span>
<span class="optQuizup"><input id="chkOption10" type="checkbox" name="chkOption10" onclick="uncheckOthers(chkOption10,1,4);" /><label for="chkOption10">asdkf<br></label></span>
<span class="optQuizup"><input id="chkOption11" type="checkbox" name="chkOption11" onclick="uncheckOthers(chkOption11,1,4);" /><label for="chkOption11">ugodf<br></label></span>
<span class="optQuizup"><input id="chkOption12" type="checkbox" name="chkOption12" onclick="uncheckOthers(chkOption12,1,4);" /><label for="chkOption12">dfgkls<br></label></span>
<span class="optQuizup"><input id="chkOption13" type="checkbox" name="chkOption13" onclick="uncheckOthers(chkOption13,1,4);" /><label for="chkOption13">kldfjls<br></label></span>
Thanks
|
|
|
|
|
i need code for when click on button it opens a new html window and automatically saves that page .
modified on Tuesday, January 20, 2009 5:03
|
|
|
|
|
window.open('url') from javascript.
Abhishek Sur
|
|
|
|
|
Use Javascript
javascript:var w=window.open('TestPage.aspx','', 'width=625,height=760,scrollbars=yes,resizeable=yes');
Hope it helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
hi sir this only creates the page not save the page . can u tell how to write it without javascript.
|
|
|
|
|
Save the page where exactly? You cant force the user to save your page!
|
|
|
|
|
When you save a Page i don't understand what you mean , can you please elaborate.
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Jas 007 wrote: can u tell how to write it without javascript.
then use Page.ClientScript.RegisterClientScriptBlock from codebehind
|
|
|
|
|
hi abhijit can u clearly explains how to use this
|
|
|
|
|
<%@ Page Language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
public void Page_Load(Object sender, EventArgs e)
{
// Define the name and type of the client scripts on the page.
String csname1 = "PopupScript";
String csname2 = "ButtonClickScript";
Type cstype = this.GetType();
// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;
// Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname1))
{
String cstext1 = "alert('Hello World');";
cs.RegisterStartupScript(cstype, csname1, cstext1, true);
}
// Check to see if the client script is already registered.
if (!cs.IsClientScriptBlockRegistered(cstype, csname2))
{
StringBuilder cstext2 = new StringBuilder();
cstext2.Append("<script type=\"text/javascript\"> function DoClick() {");
cstext2.Append("Form1.Message.value='Text from client script.'} </");
cstext2.Append("script>");
cs.RegisterClientScriptBlock(cstype, csname2, cstext2.ToString(), false);
}
}
</script>
<html >
<head>
<title>ClientScriptManager Example</title>
</head>
<body>
<form id="Form1"
runat="server">
<input type="text" id="Message" /> <input type="button" value="ClickMe" onclick="DoClick()" />
</form>
</body>
</html>
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
hi sir ,
your code does nt fulfill my requirments.
|
|
|
|
|
Abhijit Jana wrote: use Page.ClientScript.RegisterClientScriptBlock
And what's in the script block that you register? Might it be Javascript?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Jas 007 wrote: i need code for when click on button it opens a new html window
That is not possible without Javascript. The only thing that a button can do without Javascript is to post a form to the server.
You can use a link with target="_blank" to open it in a new window (or a new tab depending on browser settings).
Jas 007 wrote: and automatically saves that page
That is not possible, with or without Javascript. You can't do anything at all that involves the file system on the client computer without the interaction of the user.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have a user control with several hyperlinks to link to pages. This control is called in a master page which is common for both set of users. For example both for admin and user. The problem is that when a page is called from the folder admin the links are not good. the location to which the link points will be different. ex.
at the master page it is set -> Motion\default.aspx and when the admin page is clicked the same link from that page won't be good because the location of the current page changed. how can i fix the control to have it pointing always to the good location please? thanks for your time
|
|
|
|
|
use absolute URL's rather than relative URL's.
eg, if a page is in a folder called "rootdir" instead of of using "subdir/mypage.aspx" use "/rootdir/subdir/mypage.aspx"
|
|
|
|
|
Hi,
I am working in asp.net 2.0.I am new to ajax concept. I need some clarification about this. we can use ajax using the dll ajaxcontroltoolkit and i have seen in some site, they didn't use the ajaxcontroltoolkit dll they had written the code for the funcationality.
can anybody suggest me which one i have to use?
Thanks.
|
|
|
|
|
|
sbua wrote: can anybody suggest me which one i have to use?
It depends on you.
What you want to implement i.e. AJAX toolkit or using JavaScript.
If you are good enough in JavaScript and can write a code that is browser independent, then i suggest to go for JavaScript.
You can refer a book
AJAX in Action By Dave Crane
|
|
|
|
|
Hi sbua,
this is just a matter of taste. If you like saving time you can use the ajaxControlToolkit, but if you more the one who writes everything on his own (from memory management to the OS ) you can write the code yourself.
I suggest using the Ajax ControlToolkit since it provides most of the functions you will need.
By the way, the Ajax Control Toolkit is just a library containing controls implemented using a concept called Ajax. So this is like the Windows Forms Controls, there are implemented with a concept called object-oriented programming using the .NET framework.
Hope this helps.
Regards
Sebastian
|
|
|
|
|
|
hi every body
how are you
i have website application and i have iframe object which get it source from google maps
and ofcourse the map is changing when user change it
i want to get the image inside this i frame and save it on my server
how can i do this ???
|
|
|
|
|
i m creating controls dynamically...like i m having a button "Add More" and on click of this button i want to add dropdownlist binded from database and a link button "Remove" when user clicks on remove button the particular dropdownlist and that remove button should be removed.... but how can i do that using javascript...
|
|
|
|
|
Just use document.removeChild(element) to remove.
Also do an AJAX call to the database to remove the element from server as well..
Abhishek Sur
|
|
|
|
|
Hi
I was just wondering if there is any easy way to build a ASP.NET frontend for an existing C++/win32 based application for some heavy processing.
I have this C++ application which I use to do some file/db input, process, store result to file/db. Now I want to be able to start/pause/stop processing and read status from the web-browser.
So how can I, by using ASP.NET (and the nature of http), communicate with this process?
Any ideas? I would really appreciate it...
|
|
|
|
|
Well, from ASP.NET frontend it can be done. But be sure to check the status when the page is loading. Its because, IIS creates a new session for every new session. So if the process is already started or stopped from another browser, you cannot start it again. So before doing anything just check the status.
You can also use WCF, the new concept to do the same.
Abhishek Sur
|
|
|
|