|
You should ask this question to folks at Mozilla or at least add some code or link to demo AND version of browser.
No more Mister Nice Guy... >: |
|
|
|
|
|
<pre lang="HTML"> <span id="span3" class="cBtnLeft"><span class="cBtnRight">
<asp:Button ID="btnDupCheck" runat="server" OnClientClick="LoadingPanel.Show();"
OnClick="btnDupCheck_Click" Text="Next" CssClass="cBtnRight" Width="60px" TabIndex="11" UseSubmitBehavior="true"/>
</span></span><span id="span4" class="cBtnLeft"><span
class="cBtnRight">
<asp:Button ID="btnCncl" runat="server" Text="Cancel" OnClick="btnCncl_OnClick" OnClientClick="LoadingPanel.Show();"
CssClass="cBtnRight" Width="60px" TabIndex="12" />
These are the buttons and UseSubmitBehavior will not help . Firefox version is 16.0.2
</span></span>
|
|
|
|
|
Are you asking about using the enter button to submit a form?
If so, you have to wrap the area in a panel, and set the panels default button ID for submit. Then the content in that area, if the cursor is in the textbox, will fire the assigned button. If the cursor is not in a element within the panel, nothing will fire.
|
|
|
|
|
You can try this:
<script>
document.onkeydown=function(event)
{
e = event ? event :(window.event ? window.event : null);
if(e.keyCode==13){
//执行的方法
alert('回车检测到了');
}
}
</script>
Good luck.
|
|
|
|
|
Hi,
I would like to ask if there are any free good alternatives for Google adsense to place ads on my websites and earn money form it?
|
|
|
|
|
Adsense Alternatives
Adbrite
Infolinks
Clickbank
Admagnet
Chitika
Bidviser
But you will get very less earning as compare to Adsense
|
|
|
|
|
Thanks in advance.
Front End : Asp.net 4 (vb)
On a Page i have a button which redirects to another Page
response.redirect("Page2.aspx" + "?ID=" & DocumentID)
on Page2 load event through querystring i get the Document ID and Open the Document (PDF/IMAGE etc), My Problem is on this Page2, I want to have a button with back page link but the button does not show as the page is loaded, So is there any way to show back link along with the document.
To kill a DEER, You need Guns, knives, Ropes and many people to help But To kill
a DEAR,
You need just ignorance and silence
modified 27-Nov-12 2:50am.
|
|
|
|
|
If your users browsers allowing that you can use HTML5 History API
http://diveintohtml5.info/history.html
No more Mister Nice Guy... >: |
|
|
|
|
|
Thanks for the Post ,
Actually when Page opens it does not show any control on the Page, No button or any control , it hides the control on the page.
If it shows control then on that i can use any script or code, but now its hiding every thing from the page and just showind the document (image/text/pdf) etc.
To kill a DEER, You need Guns, knives, Ropes and many people to help But To kill
a DEAR,
You need just ignorance and silence
|
|
|
|
|
Then open this document in frame and add any controls you want on frame parent.
No more Mister Nice Guy... >: |
|
|
|
|
|
Tried , different Div, panel and frame but problem is when page loads it does not show any control.
To kill a DEER, You need Guns, knives, Ropes and many people to help But To kill
a DEAR,
You need just ignorance and silence
|
|
|
|
|
Obviously if your doing
response.redirect("Page2.aspx" + "?ID=" & DocumentID)
And then Page2 fetch file from somewhere and just spit it out to response, there is no HTML only this document.
This is how you doing it right?
No more Mister Nice Guy... >: |
|
|
|
|
|
Yes
To kill a DEER, You need Guns, knives, Ropes and many people to help But To kill
a DEAR,
You need just ignorance and silence
|
|
|
|
|
Then as I wrote before, instead of redirecting to Page2 you should add frame to your previous page and open this Document (Page2) in that frame.
No more Mister Nice Guy... >: |
|
|
|
|
|
Ok, Thanks
To kill a DEER, You need Guns, knives, Ropes and many people to help But To kill
a DEAR,
You need just ignorance and silence
|
|
|
|
|
Load your PDF/IMAGE etc into an inline frame
<iframe src="name of your pdf document or image" />
Then UNDER the iframe add this clientside code....
<input type="button" id="btnBack" onclick="window.history.back()" />
|
|
|
|
|
Thanks
To kill a DEER, You need Guns, knives, Ropes and many people to help But To kill
a DEAR,
You need just ignorance and silence
|
|
|
|
|
|
Hi,
How i can call javascript OK function in click event of btnOK :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GridviewGhataKhadamat.aspx.cs"
Inherits="Tina.WebUI.WorkFlows.Forms.Khadamat.GridviewGhataKhadamat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function Close() {
window.close();
}
function OK(Id,Name,Code) {
var vReturnValue = new Object();
vReturnValue.Id = Id;
vReturnValue.Name = Name;
vReturnValue.Code = Code;
window.returnValue = vReturnValue;
window.close();
}
</script>
</head>
<body >
<form id="form1" runat="server">
<div>
<%----%>
<asp:GridView ID="gvGhataKhadamat" runat="server" AutoGenerateColumns="False" BackColor="White"
BorderColor="#CC9966" BorderStyle="Inset" BorderWidth="1px" CellPadding="4" Font-Names="Verdana">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<Columns>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<input name="rbGhataKhadamat" type="radio" value="<%# Eval("Id") %>,<%# Eval("Name") %>,<%# Eval("Code") %>" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Id" HeaderText="ID" Visible="false" />
<asp:BoundField DataField="Code" HeaderText="<%$ Resources:Khadamat, Code %>" />
<asp:BoundField DataField="Name" HeaderText="<%$ Resources:Khadamat, Name %>" />
</Columns>
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
</asp:GridView>
</div>
<asp:Button runat="server" ID="btnOk" Text="<%$ Resources:Khadamat, ok %>"
OnClick="btnOk_Click"/>
<asp:Button runat="server" ID="btnCancel" Text="<%$ Resources:Khadamat, cancel %>"
OnClientClick="Close()" />
</form>
</body>
</html>
and this is bihind code
protected void btnOk_Click(object sender, EventArgs e)
{
string[] strSelected=Request.Form["rbGhataKhadamat"].Split(new char[]{','});
Page.ClientScript.RegisterStartupScript(GetType(), "OK", "OK(" + "'" + strSelected[0] + "','" + strSelected[1] + "','" + strSelected[2] + "'"+");", true);
}
it doesnt call OK function.
id didnt used onclientclick event cause i must pass the selected grid values.
thanks in advanced!
modified 17-Nov-12 4:50am.
|
|
|
|
|
I solved by adding <base target="_self" /> to of this (child) page.
my code is now this :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GridviewGhataKhadamat.aspx.cs"
Inherits="Tina.WebUI.WorkFlows.Forms.Khadamat.GridviewGhataKhadamat"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function Close() {
window.close();
}
function OK(Id,Name,Code) {
var vReturnValue = new Object();
vReturnValue.Id = Id;
vReturnValue.Name = Name;
vReturnValue.Code = Code;
window.returnValue = vReturnValue;
window.close();
}
</script>
<base target=_self>
</head>
<body >
<form id="form1" runat="server">
<div>
<%----%>
<asp:GridView ID="gvGhataKhadamat" runat="server" AutoGenerateColumns="False" BackColor="White"
BorderColor="#CC9966" BorderStyle="Inset" BorderWidth="1px" CellPadding="4" Font-Names="Verdana">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<Columns>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<input name="rbGhataKhadamat" type="radio" value="<%# Eval("Id") %>,<%# Eval("Name") %>,<%# Eval("Code") %>" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Id" HeaderText="ID" Visible="false" />
<asp:BoundField DataField="Code" HeaderText="<%$ Resources:Khadamat, Code %>" />
<asp:BoundField DataField="Name" HeaderText="<%$ Resources:Khadamat, Name %>" />
</Columns>
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
</asp:GridView>
</div>
<asp:Button runat="server" ID="btnOk" Text="<%$ Resources:Khadamat, ok %>" UseSubmitBehavior="false" OnClick="btnOk_Click"/>
<asp:Button runat="server" ID="btnCancel" Text="<%$ Resources:Khadamat, cancel %>"
OnClientClick="Close()" />
</form>
</body>
</html>
and bihind code is :
protected void Page_Load(object sender, EventArgs e)
{
DataTable dtGhataKhadamat = new DataTable();
string strGridViewType = Request.QueryString["gridname"];
if (strGridViewType == "Ghata")
{
dtGhataKhadamat = tblKhadamatBL.KalaViewSelectByCommandKhadamat("GroupKalaID=15");
gvGhataKhadamat.DataSource = dtGhataKhadamat;
gvGhataKhadamat.DataBind();
}
else if (strGridViewType == "Khadamat")
{
dtGhataKhadamat = tblKhadamatBL.KhadamatTypeSelectAllKhadamat();
gvGhataKhadamat.DataSource = dtGhataKhadamat;
gvGhataKhadamat.DataBind();
}
}
protected void btnOk_Click(object sender, EventArgs e)
{
string[] strSelected = Request.Form["rbGhataKhadamat"].Split(new char[] { ',' });
string jsCommand = "OK(" + "'" + strSelected[0] + "','" + strSelected[1] + "','" + strSelected[2] + "'" + ")";
Page.ClientScript.RegisterStartupScript(GetType(), "OK", jsCommand, true);
}
|
|
|
|
|
<input type="submit" name="ctl00$ContentPlaceHolder$btnCancelNotification" value="Yes" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder$btnCancelNotification", "", true, "", "", false, false))" id="ctl00_ContentPlaceHolder_btnCancelNotification" class="cBtnRight" progressmessage="Saving…" style="width:70px;" >
|
|
|
|
|
It submits the form back to the server.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi.
I´ve been creating web pages for some years now, and been moving away from creating asp.net page-controls from codebehind because of the overhead they generate and the postback challenges you encounter. Instead I´ven been relying on javascript, jquery, old-school html elements and webservices, since they give me more elegant and light solutions.
The challenge I face now, is that it should be possible to construct a page based on a xml-setup file. The page design is luckily quite simple. It´s basically a vertical page with controls on top of each other.
I´m planning to create xml elements/types that define each control with it´s attributes. For an example a textbox with a css class, numeric text only value, which method to fire on textchanged, etc.. Or a button with a width, height, text, which (javascript?) method to fire upon click. Based on these types, I create the controls on the page.
My question is, should I create and insert these controls from codebehind, that means asp.net controls?
Or should I, for an example, build the dom in codebehind and let the javascript get the DOM from webservice, and then inject it on the page? Or what would be a good approach to this problem?
Thank you in advance
Kind regards,
Lars
|
|
|
|
|
I currently build main structures or containers in code behind via server controls on the server side because it's fast, and then use javascript to build the HTML inside the empty containers after a web service request to populate them on demand or if it's just simply needed.
On the Javascript side, I use createElement, I don't write "<>< >" out, I did that in my earlier days. Writing HTML in pure javascript is very time consuming, so I keep it limited now.
I don't know about your xml idea, still thinking about that, actually I don't get it.
But on the latter question, It's a balance between time to create, and functionality. I personally don't like the Microsoft Ajax toolkit, and I'm stopped using it completely now, replacing it with jquery.
|
|
|
|
|
Thanks alot for your answer.
Ok, so you build the page structure from codebehind, and the content controls with javascript/jquery.
My challenge is a little different though. What I meant with the xml thing, is that the whole site has a setup file, which defines the controls on the page. Like this:
<PageSetup>
<Control Type="TextBox" CssClass="test" PageOrder="1" Text="Default text in the textbox" />
<Control Type="Drowdown" CssClass="dropdownClass" PageOrder="2" >
<Item text="Dropdown item 1" Value="1000" />
<Item text="Dropdown item 2" Value="2000" />
</Control>
...
</PageSetup>
Hope that clearifies it a bit
I´ve started the project, and chosen to avoid the asp.net controls. So right now I build a long html string from codebehind, bases on the xml settings, and inject it on the page with jquery.
Any better idea?
Thanks alot for your time!
|
|
|
|
|