|
Hi....
I have created multiple file uploads on button click through javascript.
It works fine...
But the problem is that when i fire any server hit in that page the controls i have added is gone, and i have to add them again.
kindly help to resolve this issue.
Thanks.
Here is code.
var i=0;
function addAttachment()
{
i++;
var atts=document.getElementById("attachments");
//create child div
var divChild=document.createElement("div");
divChild.id="div"+i.toString();
atts.appendChild(divChild);
var newAtt=document.createElement("input");
newAtt.id="file"+i.toString();
newAtt.name="file"+i.toString();
newAtt.type="file";
divChild.appendChild(newAtt);
//Create a tag
var aElement=document.createElement("a");
aElement.id="afile"+i.toString();
var aText=document.createTextNode("remove");
aElement.appendChild(aText);
aElement.setAttribute("href","#");
if(navigator.appName=="Microsoft Internet Explorer")
{
aElement.attachEvent("onclick",removeFun(divChild.id));
}
else
{
var eventHander=function(){removeAttachment.call(divChild.id);}
aElement.addEventListener("click",removeFun(divChild.id),false);
}
divChild.appendChild(aElement);
}
var removeFun=function(childDivId)
{
return function(){removeAttachment(childDivId);}
}
function removeAttachment(childDivId)
{
var atts=document.getElementById("attachments");
var child1=document.getElementById(childDivId.toString());
atts.removeChild(child1);
}
|
|
|
|
|
i have a gridview with multiple columns in which one column is dropdownlist.
i want to update gridview row on dropdown selection change event. i do this, but problem is that when row is updated on dropdown selection change event, this page has other server side controls eg. buttons , problem is that when i click any button on page, selected drop down event row data disappear.
please any body tell me how to solve that problem.
|
|
|
|
|
Could you post your gridview fillimg code.
Regards,
Kaushal Arora
|
|
|
|
|
i have a function loadstring in a class file like
Public Sub LoadStrings(ByVal ci As CultureInfo)
Dim HylEdit As New HyperLink
Dim BtnClear As New Button
Dim BtnSave As New Button
Dim HylView As New HyperLink
i hav inherited tis class to a aspx page where i hav those controls
like HylEdit, BtnClear, BtnSave, HylView
i want to load those controls wit values tat i hav assigned to it
|
|
|
|
|
Dim cmd = New SqlClient.SqlCommand("Update Studentmaster set Firstname='" & txtsfname.Text & "', Middlename='" & txtsmname.Text & "', Lastname='" & txtslname.Text & "', Address1='" & txtadd1.Text & "', Address2='" & txtadd2.Text & "', City='" & txtcity.Text & "', State='" & txtstate.Text & "', Pincode=" & Val(txtpin.Text) & ", Gender='" & txtgen.Text & "', Birthdate='" & CDate(txtbdate.Text) & "', Emailid='" & txtemail.Text & "', Category='" & txtcat.Text & "', Mstatus='" & txtmstatus.Text & "', Aboutme='" & txtabtme.Text & "', Graduationcollege= '" & txtgclg.Text & "', GraduationResult= " & Val(txtgresult.Text) & ", Graduationdegree='" & txtgdeg.Text & "', Masterdegree= '" & txtmdeg.Text & "', Mastercollege='" & txtmclg.Text & "', HSC=" & Val(txthsc.Text) & ", SSC=" & Val(txtssc.Text) & ", Usertype='" & txtutype.Text & "', Username='" & txtuname.Text & "', Password='" & txtpasswd.Text & "', Questions='" & cmbsq.SelectedValue & "', Answer='" & txtans.Text & "' where Studentid= '" & Session.Item("studentid") & "' ", c)
cmd.ExecuteNonQuery()
|
|
|
|
|
It is a tough challenge to read the code that you have posted. Format the code so that it becomes readable.
There is no foolish question, there is no final answer...
|
|
|
|
|
I could find its a VB code. Apart from the I couldn't understand anything.
You are best person who knows about your problem.
-------------------------------------------------
More pain more gain
|
|
|
|
|
CP has provided an editor to post code with proper formatting.
|
|
|
|
|
Without trying to decode this mess, the error means what it says. So, use the debugger, look at the value you're casting, and ask yourself why the error message is valid ( as it must be )
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
How can I add google map to a website.ie I want to locate a particular address such as company address,location etc. using Asp.net or any scripting language.
Thanks
Denny
|
|
|
|
|
Denny,
Please read the documentation provided by Google. This has nothing to do with ASP.NET.
|
|
|
|
|
|
try this[^]
You are best person who knows about your problem.
-------------------------------------------------
More pain more gain
|
|
|
|
|
Thanks a lot.It helped me well.
|
|
|
|
|
Hi
I created one user control for list of years to populate in dropdownlist..
i want to use same usercontrol in pageload for two dropdown list controls(i mean i want to populate listofyears in two dropdownlists)..
I can't make same ID for two dropdownlist na..How can i call my usercontrol to two dropdowncontrols in same page???
can anyoneexplain in detail...Thanx in advance
|
|
|
|
|
First if all the UserControl contains in a dropdownlist then it is overkill, just create two dropdowns on your page and populate them from the same datasource.
only two letters away from being an asset
|
|
|
|
|
Well, if you use the same datasource, they will sync up, you need to clone the datasource for the second contrll, don't you ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Perhaps I'm missing something, or misinterpreting, the original and your post.
List<int> years = ....
DropDown1.DataSource = years
DropDown2.DataSource = years
only two letters away from being an asset
|
|
|
|
|
Maybe it's only in winforms that that won't work. Actually, I think it is only winforms.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Ok I feel silly for not being able to work this out :-/
I have an ASP project with C# using VS08.
I have then clicked add class and have a class in there that reads from a text file, works some stuff out and returns a variable. But in that class(which gets compiled to the same DLL as the rest i cannot seem to reference the txt file right. Ive tried without a directory and it throws an error and ive tried System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); and System.Environment.CurrentDirectory;
Both of which dont work either(Well they do but the text file isnt there).
So I think what im asking is how do I get VS to move the text file with the DLL when it creates its dev server(after pressing debug).
Thanks for humouring me :-/
|
|
|
|
|
Though you didn't mention it, it seems the file in question is in your project, correct? Right the file in project explorer and display properties, look at the options in Copy to Output Directory
only two letters away from being an asset
|
|
|
|
|
Shot
It was in the project but I didnt change the properties.
|
|
|
|
|
HELLO
i have an application depployed under .net 1.1, and when a client open the main page that contain multiple tab and each tab contain multiple frame, some frame or pages show the following error: page cannnnot be displayed, and when i refresh the current frame the page appear again.
i searched and i 've got multiple solution but the problem still apppear.
Any idea ??
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
Sounds like an issue with their web connection.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|