|
If you're trying to dynamically run a script, you can do this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Dynamically Loading JavaScript :: Loading thru Src</title>
<script type="text/javascript">
function dynamicLoadJS(scriptName) {
var head = document.getElementsByTagName("head")[0];
script = document.createElement('script');
script.id = "DynaScript";
script.type = 'text/javascript';
script.src = scriptName;
head.appendChild(script);
document.getElementById("LoadJS").disabled="true";
document.getElementById("CallJS").disabled="";
}</script>
</head>
<body>
<button id="LoadJS" onclick="dynamicLoadJS('./onDemandJs.js');">Load JavaScript</button>
<button id="CallJS" onclick="showHtml();" disabled="disabled">Call method from new load</button>
</body>
</html>
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I have a strange problem and I have not found any proper solution on the internet for it.
I Have a GridView component (with Claims) and if someone presses a Cell (javascript added to cell during rowdatabound of gridviewrow) the next DrillDown action should take place.
Current GridView visible false and Drilldown(in ASP page defined) GridView will become visible true.
Above and below the DrillDown grid I have a Back button. That makes the now DrillDown GridView invisble and the Claims Gridview Visible again.
As long has the DrillDown Grdidview has not too many rows, this works OK.
But when my DrillDown is getting > 4000 rows I receive a javascript error from AJAX saying
it encountered an error: PageRequestManagerServerErrorException 12030 or sometimes PageRequestManagerServerErrorException 12031.
(original Errormessages = Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12030)
Even tried to use the page without asp:UpdatePanel objects. If I Click on the Back button then I get a Webserver Error saying The page cannot be displayed.
WinInit errorcodes:
12030 ERROR_INTERNET_CONNECTION_ABORTED
The connection with the server has been terminated.
12031 ERROR_INTERNET_CONNECTION_RESET
The connection with the server has been reset.
Anyone any ideas?
|
|
|
|
|
Hi to all
I am new to asp.net 2.0.
i am having one problem in gridview. I have a gridview in that i have
set datakeyname as blgid. On rowcommand i need selected row id and
text of selected row (which is a linkbutton).I have set command argument
property of linkbutton as blgid. i got the id properly of each and every
row and i am finding control using index of the clicked row.When i am
finding text of linkbutton it got index as commandargument(blgid)
if the row index was 3 and id of that row was 8 then it got the text of
linkbutton whose indes was 8. my code is as follow.
the code for link button inside gridview as follow
<asp:TemplateField HeaderText="BlogTitle"><br />
<ItemTemplate><br />
<asp:LinkButton ID="blgname" runat="server" CommandName="blogname" CommandArgument=<%# Eval("blgid") %> ForeColor="black" Height="12px" Text='<%# (container.dataitem("blogtitle")) %>' CssClass="textforum"></asp:LinkButton><br />
</ItemTemplate><br />
<HeaderStyle CssClass="textforum" ForeColor="White" /><br />
</asp:TemplateField>
and the code on rowcommand is as follow.
Dim id As Integer = Convert.ToInt32(e.CommandArgument)<br />
Dim lnkbname As LinkButton<br />
Dim rowindex As Integer = CInt(e.CommandArgument)<br />
Dim row As GridViewRow = grd_allblogs.Rows(rowindex)<br />
lnkbname = DirectCast(row.FindControl("blgname"), LinkButton)<br />
Session("blgname") = lnkbname.Text<br />
<br />
<br />
Response.Redirect("BlogDetails.aspx?id=" & id)<br />
Please help me to solve the problem?
People Laugh on me Because i am
Different but i Laugh on them
Because they all are same.
|
|
|
|
|
I think problem is in e.commandArgument
May I know what are you passing in commandArgument?
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi
Ya problem is the command agument? I am passing blgid primery key
of my table and then catching it as
Dim id As Integer = Convert.ToInt32(e.CommandArgument)
People Laugh on me Because i am
Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Dim id As Integer = Convert.ToInt32(e.CommandArgument)
Dim rowindex As Integer = CInt(e.CommandArgument)
rowindex = ID now. if e.CommandArgument = 8, then rowindex will be 8.
You are seeking e.Row.RowIndex
|
|
|
|
|
Hi
Yes it is the problem?
i cant understand You are seeking e.Row.RowIndex
can u tell me how can i resolve this?
People Laugh on me Because i am
Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Dim rowindex = (Cint) e.Row.RowIndex
|
|
|
|
|
Ok i will try it? and tell u what happen?
Thanks.
People Laugh on me Because i am
Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hi
it it is not displaying row property after e.
It says row is not member of
System.Web.UI.WebControls.GridViewCommandEventArgs
People Laugh on me Because i am
Different but i Laugh on them
Because they all are same.
|
|
|
|
|
replace GridView with ther ID of your GridView
Dim rowindex As Integer = CInt(GridView.RowIndex)
|
|
|
|
|
Hi
Thanks i tried it. It says row index in not a member of GridView.
People Laugh on me Because i am
Different but i Laugh on them
Because they all are same.
|
|
|
|
|
i have a webpage in my wesite in which i need to receive the next record from database table after one minute is over.it is basically a quiz in which i want if user do not select any option within one minute next question should be shown. in vs2005 there is no timer control .i am using vb.net as code behind language.is there any way by declaring and using timer in code behind file.
or i have to use javascript ,but i do not know how to call code behind function in javascript. can you suggest me some ideas for this .
|
|
|
|
|
Don't u get timer in asp.net.
so what is this Timer. If u like use this one.
Devjit.
|
|
|
|
|
Hey,
There is no timer in VS2005?If u can't find add it in the tool bar and write in timer_tick event of timer.
God is always with you.
|
|
|
|
|
|
You need to use javascript, ignore the rest of the replies you got here, they're all (for some inexplicably stupid reason) referring to timers that will tick on the server side, which is effectively useless to you.
I don't know the exact syntax, but felt compelled to post to stop you from trying to implement any of the other ideas here.
|
|
|
|
|
Look for the getTimeout() function in javascript, that will give you what you want.
|
|
|
|
|
can i have two columns in a single dropdownlist
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Want to display two column data or what?
Devjit Das.
|
|
|
|
|
yes
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
if u r using sql query just join two column and make it single column and bind that column with dropdownlist . u will get ur output.
Devjit Das.
|
|
|
|
|
Search On Google U get a more Help.
|
|
|
|
|
Ya!
You see this link:
http://www.codeproject.com/aspnet/MultiColDdList.asp
God is always with you.
|
|
|
|
|
Sonia Gupta wrote: can i have two columns in a single dropdownlist
Yes
for example
your query looks like this
select firstname+' '+lastname as name from tblEmployee
now you can get name from two columns
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|