|
Thank you Guffa, your answer helped me to the solution.
I will consider changing the link and make the ID's unique, but the appendChild, removeChild and cloneNode did the work I was looking for, this now works in IE and Firefox as I planned.
<html>
<head>
<script language=javascript>
function MultiAdd(sName, iType) {
if (iType == 1) {
var o = document.getElementById(sName);
var e = o.cloneNode(true);
document.getElementById('div2'+sName).appendChild(e);
myElement = document.createElement('<br>')
document.getElementById('div2'+sName).appendChild(myElement);
} else {
var o = document.getElementById('src2'+sName);
var e = o.cloneNode(true);
document.getElementById('div2'+sName).appendChild(e);
}
}
function MultiDelete(sName, sToken, iType) {
var e = document.getElementById('div2'+sName);
if (e.childNodes.length > 0) e.removeChild(e.lastChild) ; // the <input> element
if (e.childNodes.length > 0 && iType == 1) e.removeChild(e.lastChild) ; // the <br> element
}
</script>
</head>
<body>
<form >
<table border='1' align='center' cellspacing='0' cellpadding='0'><tr><td nowrap>
<div id='src2Department' nowrap>
<select size='1' name='Department' ID='Department' onblur="this.setAttribute('value',this.value);">
<option value ='14'>Aaaa</option>
<option value ='5' >Bbbb</option>
<option value ='27'>Cccc</option>
<option value ='15'>Dddd</option>
</select>
<br />
</div>
</td><td colspan=2>
<a href="javascript:MultiAdd('Department', 1);">[+]</a>
<a href="javascript:MultiDelete('Department','<select', 1);">[-]</a>
</td></tr><tr><td colspan=2 nowrap>
<div id='div2Department'></div>
</td></tr><tr><td>
<div id='src2sGrantor' nowrap>
<input type='text' name='sGrantor' >
<br />
</div>
</td><td colspan=2>
<a href="javascript:MultiAdd('sGrantor', 2);">[+]</a>
<a href="javascript:MultiDelete('sGrantor','<input', 2);">[-]</a>
</td></tr><tr><td colspan=2 nowrap>
<div id='div2sGrantor'></div>
</td></tr></table>
</form>
</body>
Joi
|
|
|
|
|
Dear All,
whenever I try to Open New Asp2.0 Application under Http option and try to run that application , browser display error IIS Metabase Error.
Also whenever I hover over toolbox , Statusbar show initialising Toolbox and application hangs .
Develop2Program & Program2Develop
|
|
|
|
|
Check the ASP.NET version of the Application's IIS folder.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi all,
I'm working on a datgrid that inserts data. But there is a column of name that I want when a user inserts data the user's login name should appear in the column. I'm trying using Windows Authentication But The example I got is not helping me. This is a code on webconfig:
<authentication mode="Windows">
<identity impersonate="true">
<authorization>
<deny users="?">
Where I'm I going wrong?
Thanks
|
|
|
|
|
nclauder wrote: Where I'm I going wrong?
Where is the code of web.config file???
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Thanks,
The code of web config looks like:
authentication mode="Windows"
identity impersonate="true"
and the Login page looks like on(Page_load):
Response.Write(Page.User.Identity.Name);
Thanks.
|
|
|
|
|
Use the RowDataBound method of GridView to bind the data to row cells.
Here[^] is the sample for how to use RowDataBound.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Thanks,
After trying the example I'm getting this mistake While compiling:
The type or namespace name 'GridViewRowEventArgs' could not be found (are you missing a using directive or an assembly reference?)
Thanks.
|
|
|
|
|
i have a session["id"] in c# code behind file, i want to read this session from javascript.
how can i do it
thanks in advance.
haitham
|
|
|
|
|
You can place the value of session["id"] in a hidden textbox in the code behind file. You can access the value of this textbox in javascript.
Wout Louwers
|
|
|
|
|
first thanking for your reply.
if you hide the textbox and then read the value of this textbox from javascript, it is fail , it is succeeded only if the control is visible
i made it using this line document.getelementById("controlid").
thanks
haitham
|
|
|
|
|
Yhis is true if you set the visible property to false. If you set the visisble property to true, and the type property to hidden, it should do the job.
Wout Louwers
|
|
|
|
|
You can assign this to a JavaScript variable and then use it.
|
|
|
|
|
thanks for ur attention to reply me
the problem in accessing variable in code behind file from javascript
thanks.
haitham
|
|
|
|
|
Unfortunately, you can't get js to talk to the server unless you use AJAX....the way to get around it is to use asp:HiddenFields on your page. If you need access to a server side variable, store it in one when you process on the server, then at the client, use document.getElementById to retrieve the value...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
hi all
How could i Draw dynamic point Line Polyline polygon on firefox by javacript
same: http://serverx.esri.com/antialiasingexamples/
in Measure
|
|
|
|
|
With more towards Tabbed browsing and popup blockers getting powerful, I just thought there should be a way for us to target our links to open links in New Tab instead of New Window. Basically, at the code level, instead of _blank there should be a way of _blankTab.
Can somebody if come across already, throw some light on it?
|
|
|
|
|
Hello,
I am confucing about the architectures like MVC architecture and 3-tier architecture..can any body help me to clarify my doubts...and which is the best method to follow for asp.net development...
I am waiting for your reply.
Alex.
|
|
|
|
|
in one website, i have created one loging page, after user logged in, page redircts him to the welcome page, this is ok.
problem is here-------
what i want is user should not allowed to come FORWARD after hitting BACK button of the browser. that action must be redircted to the again login page.
so how to identify back and forward button?
regards
krishna
|
|
|
|
|
well make it so that the session is no longer valid after they have viewed the page, then they won't be able to view it again without signing back in.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Another option is you can compre url such while you are showing the login page first time and after logout you will have the same url. So just compare both if both are same than again put the user on login page.
--------------------------------------------------------------------------------------------------
Hiral Shah
India
If you think that my answer is good enough and can be helpful for other then don't forget to vote.
|
|
|
|
|
I want to use a dropdownlist server control with a datagrid server control sothat when i change the dropdownlist the grid changes but using AJAX. I can do it if the datagrid is a simple html table but i can't implement it if the grid is a server control datagrid. Is there anyway to display the grid as a server control using AJAX or it must be html table to display it with AJAX?
Ahmed
|
|
|
|
|
You can use Anthem.net which is a free librery for ajax controls. it include Combobox, Datagrid etc all have Ajax events, and u dont have to work with JS
http://www.codeproject.com/Ajax/AnthemNET.asp[^]
Nobody is perfect i'm Nobody
|
|
|
|
|
Or you could use the MS Ajax Extensions (the UpdatePanel will do what you need):
Linkety
|
|
|
|
|
Hello All,
I have some questions out of which some are parent and some are child questions. even child questions may also be parent questions for some other questions. like that depth goes to n level.
I need to display questions in the following way.
checkbox question
if any field impact then, fieldName Textbox
if any child questions then, checkbox question
first i need to populate all the parent questions from database.
then whenever a checkbox is checked, i need to show child questions below the question.
for some questions there are some fields for which i need to show field name and textbox and then questions
like this it is upto n levels.
can any one give me solution how to achieve this.
thanks in advance.
shiva kumar
|
|
|
|