.NET Form Name - JavaScript Variables That (sign) Reference "aspnetForm" That Are Broken?
Jul 23, 2010
From what I understand, the id of the master on an ASP.NET page is "aspnetForm". I noticed today that for some reason in one of our pages it's now "form1". What would cause this change? Where should I look for the root cause of this naming change? We've got a lot of JavaScript variables that (sign) reference "aspnetForm" that are now broken.
View 1 Replies
Similar Messages:
Mar 7, 2011
I have a page that derives from a master page. The page has a theme defined and displays properly. If I move the page to a sub folder in the web, the theme is no longer used. I see the following generated in the tag:
<link href="http://localhost:50815/MyWeb/../App_Themes/GreenBlue/StyleSheet.css" rel="stylesheet" type="text/css"/>
So the problem is the /../ Why is this being generated? How do I fix it?
One more thing, the href above is being generated by setting the page's Theme in the markup:
<%@ Page Title="" Language="C#" MasterPageFile="~/DashboardMaster.master" AutoEventWireup="true"
CodeFile="DataSourceSetup.aspx.cs" Inherits="DataSourceSetup" Theme="GreenBlue" %>
I'm not manually adding the <link href=... It is being gnerated, and incorrectly at that.
View 1 Replies
Apr 5, 2011
I'm sure I'm going about this wrong but I'm trying to write a simple javascript method that will set a hidden type value upon a link click. I'm using the Html.BeginForm() helper that contains two links similar to:
@Html.ActionLink("Delete Review Only", "Delete", new { id = Model.ReviewId }, new { onclick = "SetDeleteType(1);" })
<script language="JavaScript" type="text/javascript">
function SetDeleteType(selectedtype) {
document.supportform.deleteType.value = selectedtype;
document.supportform.submit();
}
The supportform name obviously doesn't exists since I'm using BeginForm() and can't specify a form name. Is there a clever way of doing this without calling Forms(0) using jQuery or something or am I completely off?
View 1 Replies
Mar 11, 2011
accessing the currently edited existing row in the Radgrid, as as well as the index of the Edit form when trying to add a new record to the table/
function OnClientSelectedIndexChanged(sender, eventArgs) {
var item = eventArgs.get_item();
// alert(item.get_value());
grid = $find("<%= rgSecurity.ClientID %>");
[Code]....
View 1 Replies
Jan 2, 2010
I have this code in javascript: var x = e.mapX; It gets the X-coordinate of a map. What I want to do is that I want to store this into a c# variable. I have a class named Test with an integer property X. I want to store var x into X. In the codebehind, I have this on the Page_Load: Test test = new Test(); Then I am trying this on the javascript code: var x = e.mapX;
View 16 Replies
Oct 4, 2010
I'm struggling with ASP .NET Validators JavaScript issue. Following function (part of framework generated code) tries to access validatioGroup attribute value using control.Field syntax. It works fine in IE, however in FF that value is always undefined. Consequently, validation always passes and my validation scenario is broken... Is there a way to get round it?
function IsValidationGroupMatch(control, validationGroup) {
if ((typeof(validationGroup) == "undefined") || (validationGroup == null)) {
return true;
}
var controlGroup = "";
if (typeof(control.validationGroup) == "string") {
controlGroup = control.validationGroup;
}
return (controlGroup == validationGroup);
}
View 1 Replies
Sep 8, 2010
I'm having some troubles using Session Variables as they are being used as Reference and I want to use them as value.
I got to this debuging my solution and I created something like:
DataTable dt =
(DataTable)HttpContext.Current.Session[
"SearchReturn-DataTableSchema"];
// Adding Rows of Data to DataTable dt
HttpContext.Current.Session["SearchReturn-DataTable"] = dt;
[Code]....
View 3 Replies
Jan 15, 2010
I have this .net page that is iframing a page that requires username and password. Does any one know if a way i can provide this page the username and password behind the scenes and autologin the user (from thier eyes at least)?
The calling page is a ..NET page but the page that I am iframing in is a classic ASP page.
I was told that i may have to do something like create a security auth ticket and pass the token which I am not sure how to do or even start
View 1 Replies
Jan 20, 2011
Is it possible to postback to the server, perform a function, and then continue that postback on to an external place? (ie, to a payment system)(the scenario is clicking a button to place an order, mark it as sent, then send them off to the payment page (there are form variables that needs to be sent to the payment screen as well))
View 5 Replies
Jul 6, 2010
If I were using PHP I could submit a form to a new page, or the same page, and get the posted variables by doing something such as $_POST['txtVariable'], how do I do the same thing in ASP.NET? And is it possible to have more than one form per page?
View 4 Replies
Jan 10, 2011
I am attempting to call a RESTful service using an HttpWebRequest object via POST. I am attempting to pass 1 variable with the Request body which contains a url encoded string. I see the request when it hits the server; however, it shows 2 form variables. The first is Form[null] and the second is my variable.I am attempting to locate the source of this NULL key; however, I cannot. Any ideas on how I may be able to remedy this since it's throwing issues when I attempt to use it with the Nancy web framework for .Net.
Code:
var request = WebRequest.Create("http://localhost:8888/RouteName") as HttpWebRequest;
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";[code]...
View 1 Replies
Nov 12, 2010
I have a shortcut on my desktop to a login page for a website I use quite often. Every time I go there I have to reenter my user name and password.
The desktop URL shortcut I have is
http://domain.com/service/Login.aspx
I've tried adding the following changes
http://domain.com/service/Login.aspx?username=ckimball&password=joshua1
But this doesn't auto populate the fields on the website when it loads. Is there something special I need to do so the webpage will fill in the fields on the form?
Also bonus if I could just auto submit to login so I don't need the page to load and have me click "login" but I don't think that's possible... or is it?
View 2 Replies
Apr 19, 2010
I am using form based authentication in one of my website. I issue AuthenticationTicket on successful login and use this ticket to validate request. but now I need to store other variables immidiately after authenticating request (just like adding session for username, email etc. variable after successful login).
My question is if I make use of session to store variables, do I need to concern about it as form based authemtication is cookie based and it is not related with session timeout.
View 3 Replies
Mar 6, 2010
I'm using ASP.NET MVC (I'm really new to both asp.net and the asp.net mvc type projects, but trying hard to learn).
I've set up MVC with a controller so that it runs a C#.net method which;
queries an mssql db
converts it to json
returns the json string
It's called from the javascript by requesting an url with a parameter. But what I need now is for the C# part to read two integer variables from the javascript. What would be the best way to do that, and does anyone have any good examples/code that I could look at?
View 2 Replies
Nov 10, 2010
I want to assign array of photos to imagearray but the following script is not working. i cant able to access variables a,i,cnlink etc in new fadeSlideShow() .how to access this outside the function and assign it to imagearray
<script type="text/javascript">
var i; var a; var cnLink; var cn;var cnSplit;
var photos = new Array();
var photoslink = new Array();
function x() {
a = document.getElementById('HiddenField4').value;
cnLink = document.getElementById('hdnLink').value;
cn = document.getElementById('HiddenField3').value;
cnSplit = cnLink.split(';');
while (i < cn) {
photoslink[i] = cnSplit[i];
photos[i] = b[i];
i++;
}
}
var mygallery2 = new fadeSlideShow({
wrapperid: "fadeshow2",
dimensions: [568, 313],
imagearray: [
photos
//<--array of images!
],
displaymode: { type: 'auto', pause: 2500, cycles: 0, wraparound: false },
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler"
})
</script>
View 1 Replies
Jan 2, 2012
I have a webpage in which I declared a variable in my code-behind as:
Code : Private ok As New HiddenField
I have a javascript function that sets this variable to either "T" or "F". However, I have a server-side button control that in the click() event, it checks the "ok" variable like this:
Code:
If ok.Value = "T" Then
FormatFields()
End If
The javascript function initializes the "ok" variable to "T". It goes thru a series of field edits. When a field doesn't pass the edit, it sets the "ok" variable to "F". Either way, this variable has a value. When the code-behind event above checks the "ok" variable, it's value is "".
View 1 Replies
Feb 16, 2011
I have a web form where I create an array of type structure.
In this form I have:
[code]....
but this is not OK.
View 1 Replies
Feb 16, 2011
I have a web form where I define an array of type struct and I redirected it in the <script runat="server">
section of the second web form. But when I use that array below, in the <script type="text/javascript">
section in the html code of the same web form an error occured in the for cycle saying that the array (Array1) is undefined, and also the counter which I also defined in <script runat="server"> section.
I have this code in the <script runat="server">
section of the second web form:
public struct Point1
{
public float lat;
public float long1;
}
protected void Page_Load(object sender, EventArgs e)
{
//Retreive from session
Point1[] Array1 = Session["s1"] as Point1[];
//Run a Foreach loop
int nCnt
= 0;
foreach (Point1 p1
in Array1)
{
float x1
= p1.lat;
float y1
= p1.long1;
nCnt++;
}
}
and in the <script
type="text/javascript">
section I have:
var
for (var i = 0; i <
nCnt; i++)
{
lineString.getCoordinates().pushLatLngAlt(Array1[i][0], Array1[i][1],0);
}
lineString = ge.createLineString('');
lineStringPlacemark.setGeometry(lineString);
View 17 Replies
Jan 10, 2011
I am calling a javascript function from .cs file which is as below:
private string CallValuesScript()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("$(document).ready(function() {");
sb.AppendLine("DisplayValues();");
sb.AppendLine(" });");
return sb.ToString();
}
I have two integers declared at class level private int ratingLinkId = 0 ;
private int ratingValue = 0;
how I can pass these two integer values to the function "DisplayValues();" ? I have the javascript function is aspx as below:
function DisplayRatings(id, count) {
//code
}
View 5 Replies
Jan 28, 2011
Just for an example, if I have three controls on a Master page, I would usually declare a variable for a control like this.
var elem = document.getElemntId('<%=control1.ClientID %>');
var elem2 = document.getElemntId('<%=control2.ClientID %>');
var elem3 = document.getElemntId('<%=control3.ClientID %>');
Can I do it in some form of concenation like:
[code]....
View 3 Replies
Oct 26, 2010
Is there a way to assign/pass/copy a javascript variable to a server side variable in C#? For the sake of argument, let's say that I was able to parse some JSON for variables that I want to store and assign them on the client (ie. var = FirstName and var = 25 and var = someDateTime, etc) .
View 4 Replies
Jan 28, 2011
I have a nested ListView (Master/Detail) and want to invoke a JavaScript function in the detail ItemTemplate so that this function can call a static method on the server site and post the field update. I need to include three data variables in the function call, two of which must come from the ListItem data. The JavaScript call to SaveAnswer that is contained in a list item embedded in the inner listview does not render properly. The code must pass three variables: ThisPAQID is a public variable from the codebehind. I could probably make it a hidden variable on this page. QuestionID is a variable from the current listitem and is contained in the table cell immediately preceeding the SaveAnswer method call.
The nested listview works great, and if I dummy the PAQID and QuestionID values in the function call (e.g. SaveAnswer(1,1, this.Value), it works fine.
<asp:ListView ID="lstQuestions" runat="server" OnItemDataBound="lstQuestions_ItemDataBound">
<LayoutTemplate>
<table>[code]....
When I put a breakpoint into this code in FireFox, the break never fires. Do I need an "OnBlur" tied to this code? Clearly I am not a JavaScript wizard.
View 1 Replies
Dec 18, 2010
I am working with Google maps api V3. I need to get the values of the getSouthWest & getNorthEast bounds of my map. To do this the 'bounds_changed' event needs to be fired in order to get the new values. This is all good, however, I need to access these values from outside the event and passed to a server side function (more specifically, I don't want to call my server side function every time the map bounds are changed).
My code is:
//Global
var sw, nw, Searchbounds;
function myFunc(){
google.maps.event.addListener(map, 'bounds_changed', function() {
Searchbounds = map.getBounds();
sw = Searchbounds.getSouthWest();
ne = Searchbounds.getNorthEast();
});
CallServerSideWebService(sw.lat(), ne.lng(), ne.lat(), ne.lng());
}
When executing this code I get the error message sw is undefined.
View 2 Replies
Aug 6, 2010
This is an ASP.NET 2010 web app written in vb. I use several Session variables. I want to pass them all to a central class and let the class manage them. However, I am having some trouble.
Here is the code on the calling page:
Dim arrGoodSessions() As String ={"nameofsession1", "nameofsession2", "nameofsession3"}
Utilities.ManageSessionVariables(arrGoodSessions)
It calls that static Utilties class. I have set a reference to System.Web. Here is the code in the class:
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.SessionState.HttpSessionState
Imports System.Web.HttpContext
[Code]....
This attempts to simply read in some names of session variables and then cycle through all session variables and remove any I didn't list. This works when all of the cod eis on the page. But when I move this to the class, it doesn't recgonize Session.Contents.
View 3 Replies
Mar 13, 2010
i am still stcuk with my project and unabale to perform calculation on my edited gridview..
here is my problem :
i have fields (f1,f2,f3, f4...) pulled from my sql data base table. into a gridview.
the "f4" field value is based on some calculation done on f1, f2 & f3 field values..
1- i need to have the same calculation done when i edit and update f1, f2 & f3 on my gridview...
more complicated..
2 -my calculation are based on a javascript function ...
a- how can i pass the fields values to the JavaScript variables...perform the calculation....then reassign back the result varibale to the f4 field ?? ..then update my gridview with the new calculation..
[code]....
View 6 Replies