TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tamil Selvan
1.6k
155
6.7k
How to get the value from aspx script tag to .cs
Aug 3 2019 6:12 AM
Hi,
How to get the value from aspx script tag to .cs find below
Code (.aspx):
<body>
<p>Click the button to get your coordinates.</p>
<%--<button onclick=
"getLocation()"
>Log In Time</button>--%>
<p id=
"demo1"
></p>
<p id=
"demo2"
></p>
<script type=
"text/javascript"
>
var
x = document.getElementById(
"demo1"
);
var
y = document.getElementById(
"demo2"
);
function
getLocation()
{
if
(navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(showPosition);
}
else
{
x.innerHTML =
"Geolocation is not supported by this browser."
;
}
}
function
showPosition(position)
{
x.innerHTML =
"Latitude_L1: "
+ position.coords.latitude +
"<br>"
;
document.getElementById(
'lblResLat'
).innerHTML = x.innerHTML;
}
</script>
<form runat=
"server"
>
<asp:Label ID=
"lblResLat"
runat=
"server"
></asp:Label>
<asp:Label ID=
"lblResLog"
runat=
"server"
></asp:Label>
<asp:TextBox ID=
"textbox1"
runat=
"server"
></asp:TextBox>
<asp:Button ID=
"Button1"
Text=
"Log In Time"
OnClick=
"btnlog_Click"
runat=
"server"
/>
Code Behind(.cs):
protected
void
btnlog_Click(
object
sender, EventArgs e)
{
string
val = lblResLat.Text;
}
OR
How to store the value in sql server database.
Reply
Answers (
2
)
Reading a text file from local and paste in a label
how i can start .net