|
I doubt you can. You may be able to write some javascript which doesn't allow typing in the textbox, but the file upload as a rule is pretty heavily sandboxed, because it is a security risk.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Add the following code to the code behind of the page.
protected void Page_Load(object sender, EventArgs e)
{
FileUpload1.Attributes.Add("onKeyDown", "if((event.keyCode == 8 ) ||(event.keyCode == 9) || (event.keyCode == 12) || (event.keyCode == 27) || (event.keyCode == 37) || (event.keyCode == 39) || (event.keyCode == 46))return true;else return false;");
}
|
|
|
|
|
Hi,
I need help regarding displaying small popup message when user mouse over the pointer the hyperlink, I have created this with javascript and it is showing the required popup onmouseover and onMouseOut it is hiding the popup using kill() method given below in code snippest but problem is whenever u scroll the page the popup msg will get displayed at the top and not on the hyperlink(onMouseOver)..
If anyone is having any idea of setting the mouse pointer to desired location or any alternate solution to show onHover popup using javascript.
Plz see code below:
//Hover Text for SSN
Xoffset= 20 //-10; //-60; // modify these values to ...
Yoffset= -25 //-150; //20; // change the popup position.
var old,skn,iex=(document.all),yyy=-1000;
var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all
if (ns4)
skn=document.dek
else if (ns6)
skn=document.getElementById("dek").style
else if (ie4)
skn=document.all.dek.style
if(ns4)document.captureEvents(Event.MOUSEMOVE);
else
{
skn.visibility="visible"
skn.display="none"
}
document.onmousemove=get_mouse;
function popup(msg,bak)
{
var content="<TABLE WIDTH=250 BORDER=1 BORDERCOLOR=#01244E CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD ALIGN=left style='padding-left:5px;font-size:8pt;font-family:Arial;color:#01244E'>"+msg+"</TD></TABLE>";
yyy=Yoffset;
if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}
function get_mouse(e)
{
var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
skn.left=x+Xoffset;
var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
skn.top=y+yyy;
}
function kill()
{
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}
|
|
|
|
|
My first google hit for javascript scroll position gave me this:
To save the last scroll positions (horizontal and vertical):
var hscroll = (document.all ? document.scrollLeft : window.pageXOffset);
var vscroll = (document.all ? document.scrollTop : window.pageYOffset);
then when you swap in the new form just scroll to those positions:
window.scrollTo(hscroll, vscroll);
So, you need to use the values being used in this code, to offset your menu by the scrollbar position.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi,,
I'm new in .Net, any one help me...
how to add multiple rows on the single datatable. without using SQL-Server.
I need to add the multiple textbox values to the Datatable.
Thanks.
|
|
|
|
|
Why do you need to add rows to a data table without using SQL Server ? Is this a homework assignment ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
what are you exactly looking for. If datatable schema is defined use
DataRow dr = dt.NewRow()
then assign values to the fields of dr.
Finally
dt.Rows.add(dr);
you are done.
|
|
|
|
|
hello
i have a problem
i want to display image in label by retriveing the upload photo path from database i used the select path from database and reader but this is not working
|
|
|
|
|
A label cannot show an image. If the image is in the DB, you need to write a page that returns the image from the DB based on an id on the URL, and make that what an img control points to as a source.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
so i need to display an image in one page when clicked in gridview row and taking image from folder and image path is saved in database how can i retrive image
|
|
|
|
|
Rajee Maharjan wrote: how can i retrive image
Well, it's in the database, so you get it back with SQL. And then you access it in the way I told you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i use the code
while dr.read()
response.write(dr("imagepath").tostring())
end while
when i run not executing inside the loop what happened
|
|
|
|
|
It appears you have no idea what you're doing. I mean your ability to understand how to use an internet forum, not your code. However, I also don't see how this code is a response to my advice. Is there any point in trying to help you ? Do you know anything about programming at all ?
A response.write is useless. You need to set the content type and write it as binary data, not as a string.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi
i am working on a page to show how many time this page is visiting..
how can i do it..
i applied this by adding 1 on opening this page. but on revisiting this link how i prevent to increment no of view on same user
|
|
|
|
|
You would require the user to log in, and only count logged in views. Or you could store a cookie and hope they support cookies, that they don't have more than one PC and that they never delete it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
you can use database table too store the value
One person's data is another person's program.
--J.Walia
|
|
|
|
|
iam adding items to the dropdownlist using javascript function while loading the page.using the webservice.now when click on save button how can i get the value selected in the dropdownlist in the code behind,my problem is that the value selected in the dropdownlist is getting null when i accessing through code behind
|
|
|
|
|
Show the code for both JavaScript and Codebehind ( just adding item in Dropdown and Retreving from it ).
|
|
|
|
|
in javascript
=============
<script type="text/javascript" language ="javascript" >
function AddItem()
{
var opt = document.createElement("option");
document.getElementById("DropDownList1").options.add(opt);
opt.text="One";
opt.value="One"
var opt = document.createElement("option");
document.getElementById("DropDownList1").options.add(opt);
opt.text="Two";
opt.value="Two"
var opt = document.createElement("option");
document.getElementById("DropDownList1").options.add(opt);
opt.text="Three";
opt.value="Three";
return false;
}
function GetDropDownValue()
{
alert("h")
var ddlValue;
var objControl = document.getElementById('<%=DropDownList1.ClientID %>');
alert(objControl.selectedIndex)
ddlValue=objControl.options[o
bjControl.selectedIndex].value;
document.getElementById('hfldResult').value = ddlValue;
}
</script>
in code behind
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tJavaScript As String = ""
tJavaScript = "<script language='javascript'>GetDropDownValue();</script>"
Page.ClientScript.RegisterStartupScript(Me.GetType, "abc", tJavaScript)
End Sub
|
|
|
|
|
lakshmichawala wrote: document.getElementById('hfldResult').value = ddlValue;
So, are you accessing this control, or the drop list in your code behind ? You have not posted that code, that I can see.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
ya in hidden field iam giving the ddl selected value but iam getting null while accessing the value
|
|
|
|
|
Are you trying to make it impossible for people to help you ? How about posting the code you use to access the value, the script for the control, etc. Why are you not using the client ID from the server to access the hidden field, but you do for the drop down list ? Have you inserts js code to make sure the right control is being found and it's value set ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I really don't understand what you are doing.
lakshmichawala wrote: var opt = document.createElement("option");
document.getElementById("DropDownList1").options.add(opt);
Where you actual create the DrodownList list?
Sometimes you are get taking
document.getElementById("DropDownList1")
and some time
document.getElementById('<%=DropDownList1.ClientID %>');
Please be specific what is your actual requirement is. As per my understanding You have a Dropdownlist ( Server Side Control ) you add value in the list from JavaScript. Now you want to access the value from Code behind itself. Correct me if I am wrong.
|
|
|
|
|
lakshmichawala wrote: document.getElementById("DropDownList1").options.add(opt);
access your dropdown in javascript
document.getElementById("<%=DropDownList1.ClientID %>").options.add(opt);
I dont think that your value is getting updated in dropdown
Cheers!!
Brij
|
|
|
|
|
tq i hv solved my problem using request.form in my code behind
eg:
request.form("dropdownlist1")
|
|
|
|