Initialized From A Static .js File Using A Selector?

Mar 23, 2011

I'm using jQuery tabs, which are initialized from a static .js file using a selector:

$()
.ready(function () {
$('.jqTabsStandard').tabs();
});

I'm using ASP.NET (not that it makes a difference I think), but when I click a button in one of the tabs, is there a way I can re-select that tab when the page reloads. I was thinking of sticking the tab section in an UpdatePanel. I was hoping there's a way I could trigger the tab to reselect.

View 2 Replies


Similar Messages:

CSS ID Selector Not Working But Class Selector Does?

Feb 21, 2010

I am having a problem in that a style is not being applied when I used an "ID" selector (#btnOK). However, if I use a class selector (.btnOK, by changing the "#btnOK" to a ".btnOK" in the CSS file), the style is applied.

The style IS also applied in design mode, but not at run time. It's findingf the css file, else, the class wouldn't be applied. Case sensitivity match on the ID.

In the web page:

<link href="CSS/CvCost.css" rel="stylesheet" type="text/css" />
<asp:Button ID="btnOK" CssClass="btnOK" runat="server" Text="OK" ValidationGroup="Add"/>

In CSS/CvCost.css:

#btnOK{
margin-right:5px;
margin-top:5px;
float:right;
width:75px;
height: 25px;
}

View 2 Replies

Is It Possible To Map A CSS Class Selector To A Tag Selector

Feb 14, 2011

More specifically, given a set of style sheets that define a class selector called "content_title", is there a way to apply that style to all <h1> tags without changing each one to <h1 class="content_title">, i.e. to effectively apply that class to all instances of a given element?

The context is that I'm trying to apply HTML and CSS from a graphic designer to existing web applications and some of the selectors don't match up very well.

I have an ASP.NET web forms application that uses master pages and a theme. I've been given an HTML sample/template that that includes several style sheets.

So I updated my master page to use the new design, and now it looks something like this:

<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="MyMaster.master.vb" Inherits="MyApp.MyMaster" %>
<!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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!-- these are the new style sheet from the graphic designer -->......

My goal is to use the designer's style without having to edit every content page that includes an <h1>.

I could copy the styles from the designer's CSS to the stylsheet in my app's Theme (substituting the class selector for the tag, of course), but then i wouldn't really be using the source CSS and I'd have to do this again the next time the external CSS changes.

I'm also not likely to get the external CSS changed to fit my app.

So is there something clever I can do to make <h1> == class="content_title" with respect to the application of styles, or will I have to bite the bullet and update each and every one of my content pages?

View 4 Replies

Public Static Variable Declared In Public Static Class MyGlobals In A 'Code File' Template?

Jan 27, 2011

I have a question about C Sharp ASP.NET:Is there a difference (in code speed, resources) between:public static variable declared in public static class MyGlobals in a 'Code File' template;and the variable declared in a normal 'Class File' template;I use this variable in 2 different Class Files and also in _Default Page codebehind cs file.In fact in my case I need about 20 global variables of type List<string>.

View 9 Replies

Vb.net - Generate A Static Url A File?

Jan 7, 2010

I would like to generate a static URL based on a few parameters.The page serve the file for downloading is called CertificateDownload.aspx ,I am generating the download link in Report.aspx.These 2 files reside on the same physical folder.I do not like the replace method ,but I could not think of another way of doing it.How can I improve my code or what is a better way of doing it.

I need the absolute url to be displayed as text in the web browser.

Dim downLoadUrl As String = HttpContext.Current.Request.Url.ToString.Replace("Report.aspx", "CertificateDownload.aspx") + "?CertificateID=" + CertificateName
HyperLinkDownloadLink.Visible = True
HyperLinkDownloadLink.Text = downLoadUrl
HyperLinkDownloadLink.NavigateUrl = downLoadUrl

View 3 Replies

Web Forms :: Generate A Static Url A File?

Jan 7, 2010

I would like to generate a static URL based on a few parameters. The page serve the file for downloading is called CertificateDownload.aspx ,I am generating the download link in Report.aspx.These 2 files reside on the same physical folder.I do not like the replace method ,but I could not think of another way of doing it. How can I improve my code or what is a better way of doing it.

I need the absolute url to be displayed as text in the web browser.

[Code]....

[Code]....

View 2 Replies

Reading Static File From App_Data Folder?

Apr 23, 2010

I have put a css file in App_Data folder and referrenced it properly in the page to be used. But when I browse the page then it does get loaded and page is shown without styling. Well I know why it is happening because Asp.Net run time blocks access to App_Data folder at run time. But I wanna ask that how we can make it working that is I put the css file in App_Data folder and it still works.

View 8 Replies

Get Directory App_Data In A Static Helper File?

Feb 6, 2010

What am I supposed to write as CategoryPath to get the file in the App_Data folder?

/// <summary>
/// Summary description for XMLHelper
/// </summary>
public static class XMLHelper
{
public static string CategoryPath = "App_Data/Categories.xml";
public static void InsertCategory(string categoryName, string moderator)
{
XElement cat = XElement.Load(CategoryPath);

View 1 Replies

C# - Is It Safe To Access .net Session Variables Through Static Properties Of A Static Object

May 10, 2010

Is it safe to access asp.net session variables through static properties of a static object?Here is what I mean:

public static class SessionHelper
{
public static int Age
{
get
{
[code]...

Is it possible that userA could access userB's session data this way?

View 2 Replies

C# - How To Lock A Private Static Field Of A Class In One Static Method

Mar 26, 2011

I have a private static field in my Controller class in an MVC web application.

I have a static method in that controller that assigns some value to that static field, I want to apply lock on that static field until some other instance method in the controller uses the value stored in the static field and then releases it.

DETAILS:

I have a controller named BaseController having a static ClientId field as follows and two methods as follows:-

public static string ClientId = "";
static void OnClientConnected(string clientId, ref Dictionary<string, object> list)
{
list.Add("a", "b");
// I want the ClientId to be locked here, so that it can not be accessed by other requests coming to the server and wait for ClientId to be released:-
BaseController.clientId = clientId;
}
public ActionResult Handler()
{
if (something)
{
// use the static ClientId here
}
// Release the ClientId here, so it can now be used by other web requests coming to the server.
return View();
}

View 1 Replies

Selector For Dynamically Generated ID?

Jan 25, 2011

I have a series of div where the id is tagged with the conventional:

<div id="result<%=order.ID %>">

The handler that submits the form can find out what order.ID is via:

fromInput.split(",")[1]

So how do i get that element concatenated with the static part of the DIV id?

[code]....

View 1 Replies

JQuery :: How To Get Client Id In Selector

Aug 24, 2010

I am trying to get the clientid of button in my jquery selector like this

[Code]....

Here i have hard coded the button id looking at the rendered html source but I want it dynamic using buttonid.clientid.

how to do that?

View 4 Replies

AJAX :: Calling Non-static Methods From A Static Method?

Jun 30, 2010

I did some research after posting. All I found was simple examples for no-layer architectures, like connecting to a database from your aspx page, so, in a corporate environment, it is unnaceptable.

I need to call a server-side method (using ASP.NET Ajax) in a 3-layer architecture.

For example, my Default.aspx contains a method LoadProducts().

[Code]....

[Code]....

This cannot change. There is no way to convert Business and Data layers to static.

How can I call the LoadProducts() method using ASP.NET Ajax?

View 2 Replies

Web Forms :: Accessing Static Variable In Global.ashx File?

Sep 28, 2010

I want to access the static variable in my global.ashx file I am using classname.variable name for accessing the variable but the variable name dose not appear.Can someone tell me how to access static varialbe in *.ashx file.

View 5 Replies

C# - Caching W/file Dependency: Static Var Vs. AspNet Cache Vs. Memcached

Sep 29, 2010

TL;DR: Which is likely faster: accessing static local variable, accessing variable stored in HttpRuntime.Cache, or accessing variable stored in memcached?At work, we get about 200,000 page views/day. On our homepage, we display a promotion. This promotion is different for different users, based on their country of origin and language.

All the different promotions are defined in an XML file on each web server. We have 12 web servers all serving the same site with the same XML file. There are about 50 different promotion combinations based on country/language. We imagine we'll never have more than 200 or so (if ever) promotions (combinations) total.

The XML file may be changed at any time, out of release cycle. When it's changed, the new definitions of promotions should immediately change on the live site. Implementing the functionality for this requirement is the responsibility of another developer and I.

Originally, I wrote the code so that the contents of the XML file were parsed and then stored in a static member of a class. A FileSystemWatcher monitored changes to the file, and whenever the file was changed, the XML would be reloaded/reparsed and the static member would be updated with the new contents. Seemed like a solid, simple solution to keeping the in-memory dictionary of promotions current with the XML file. (Each server doing this indepedently with its local copy of the XML file; all XML files are the same and change at the same time.)

The other developer I was working holds a Sr. position and decided that this was no good. Instead, we should store all the promotions in each server's HttpContext.Current.Cache with a CacheDependency file dependency that automatically monitored file changes, expunging the cached promotions when the file changed. While I liked that we no longer had to use a FileSystemWatcher, I worried a little that grabbing the promotions from the volitile cache instead of a static class member would be less performant.

(Care to comment on this concern? I already gave up trying to advocate not switching to HttpRuntime.Cache.)

Later, after we began using HttpRuntime.Cache, we adopted memcached with Enyim as our .NET interface for other business problems (e.g. search results). When we did that, this Sr. Developer decided we should be using memcached instead of the HttpRuntime (HttpContext) Cache for storing promotions. Higher-ups said "yeah, sounds good", and gave him a dedicated server with memcached just for these promotions. Now he's currently implementing the changes to use memcached instead.

I'm skeptical that this is a good decision. Instead of staying in-process and grabbing this promotion data from the HttpRuntime.Cache, we're now opening a socket to a network memcached server and transmitting its value to our web server.This has to be less performant, right? Even if the cache is memcached. (I haven't had the chance to compile any performance metrics yet.)On top of that, he's going to have to engineer his own file dependency solution over memcached since it doesn't provide such a facility.

Wouldn't my original design be best? Does this strike you as overengineering? Is HttpRuntime.Cache caching or memcached caching even necessary?

View 2 Replies

JQuery Selector - Finding Img In Table

Mar 8, 2010

Cant seem to get the following to find the 'skull' button when the 'heart' button is clicked. Here is the JQuery.

$(".voteup").click(function() {
var id = $(this).attr("title");
var userID = $('[id$=HiddenFieldUserID]').val();
var ipAddress = $('[id$=HiddenFieldIPAddress]').val();
var skullButton = $(this).parent().siblings(".votedowntd").children("votedown");
registerUpVote("up", id, $(this), skullButton, userID, ipAddress);
});
And the HTML...
<table width="200px">
<td width="35px" class="votedowntd">
<img src='<%# (bool)Eval("skull") ? "images/skull.png" : "images/skull-bw.png" %>' alt="Vote Down" class="votedown" title='<%# Eval("entry.ID") %>' />
</td>
<td width="130px" style="text-align: center;">
Num Votes Goes Here
</td>
<td width="35px" class="voteuptd">
<img src='<%# (bool)Eval("heart") ? "images/heart.png" : "images/heart-bw.png" %>' alt="Vote Up" class="voteup" title='<%# Eval("entry.ID") %>' />
</td>
<tr>
</tr>
</table>

So basically what I need to do is when one img is clicked, I need to find the other one. Why is what I have not working? Is there a better way to do this?

View 1 Replies

Can Write A Selector For Specific Column Of GridView

Apr 4, 2011

how can i write a selector for specific column of GridView ?

i want to do something on mouseover of a GridView Column. and i want to do it once.

Here is my gridview :

<asp:GridView AutoGenerateColumns="False" Width="100%" ID="grvUsers" runat="server">
<Columns>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# eval("ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Html Output :

<table cellspacing="0" rules="all" border="1" id="grvUsers" style="width:100%;border-collapse:collapse;">
<tr>
<th scope="col">Delete</th>
</tr><tr>
<td>
<span id="grvUsers_Label1_0">23</span>
</td>
</tr>
</table>

GridView DataBound

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dr As DataRow
Dim dt As New DataTable
dt.Columns.Add("id")
dr = dt.NewRow
dr(0) = "23"
dt.Rows.Add(dr)
grvUsers.DataSource = dt
grvUsers.DataBind()
End Sub

View 1 Replies

Asp - Visible Selector Not Working In Internet Explorer

Aug 3, 2010

I'm working on some basic form validation styles for an ASP.Net website. I need to select all span elements that are visible, and add a css style to another element. (Just to indicate which input fields are invalid.) The below code works like a charm in FF and Safari, but fails in IE. I've narrowed the problem down to the :visible selector. Here's the jQuery code. IMPORTANT NOTE: Production site is running jQuery 1.3.1 There were changes made to the :visible selector in 1.3.2 release notes

$('span.inputError:visible').each(function() {
$(this).parent().parent().prev('td').children('label').children('span').css('color','red');
});

Here's the rendered HTML it's intended for:

<table width="100%" cellspacing="0" cellpadding="3" border="0">
<tbody>
<tr>
<td valign="top" style="text-align: right;" class="address_labels">
<label><span>*</span> First Name: </label>
</td>
<td>
<span id="ctl00_CMain_txtFirstName_wrapper"><input type="text" style="width: 190px;" invalidstyle="inputError" class="radEnabledCss Input" name="ctl00_CMain_txtFirstName_text" id="ctl00_CMain_txtFirstName_text" size="20" value=" zdogg"><input type="text" value=" zdogg" style="border: 0pt none ; margin: -18px 0pt 0pt; padding: 0pt; overflow: hidden; visibility: hidden; width: 1px; height: 1px;" name="ctl00$CMain$txtFirstName" id="ctl00_CMain_txtFirstName"><input type="hidden" name="ctl00_CMain_txtFirstName_ClientState" id="ctl00_CMain_txtFirstName_ClientState" autocomplete="off"></span>
<div>
<span style="color: Red; display: none;" class="inputError" id="ctl00_CMain_valFirstName">First name is required</span>
</div>
</td>
</tr>
</tbody></table>

View 1 Replies

WebMatrix :: Workspace Selector - ToolTip On Mouse-over?

Aug 11, 2010

For the Workspace Selector at the bottom in the left pane (Sites,Files,DataBase,Reports) I was expecting to see some ToolTip upon mouse-over.

If I minimize the pane, it just shows icons, but if I mouse-over there is no way to know what each icon means.

View 2 Replies

Connection Property Has Not Been Initialized

Dec 27, 2014

In some posts I have read on other forums, those with database connection problems (I am thinking about Access) sometimes get the error: 'Connection property has not been initialized' which might translate as 'you have not kick-started your connection'. One reason for that, according to a number of replies I have come across, is that 'you have not set the connection property of the command object' ('you have not told command how to connect').

So would something like this:

Code:
Dim conn As New OleDbConnection
Dim OleDbConnection As New OleDbConnection
Dim cmd As New OleDbCommand
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|myDatabase.mdb;"
conn.Open()
cmd = New OleDbCommand("SELECT strName FROM school WHERE strName=@strName", conn)
cmd.Parameters.AddWithValue("@strName", UserName.Text)
cmd.Connection = conn
cmd.ExecuteNonQuery()
conn.Close()

a) initialise the connection property and b) set the connection property of the command object?

View 7 Replies

Is There A Cross-browser Way To Use A JQuery Selector On An Expando Property

Sep 2, 2010

I have an ASP.NET page and I am trying to quickly match the validation controls that are tied to a particular textbox (text input) using a jQuery selector. The validation controls render as a span and the "controltovalidate" property renders as an expando property. Here is a test example:

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>......

The problem: the ml_test() function shows 1 in Internet Explorer 7 (as expected), but shows 0 in Firefox 3.6.8. I tried adding additional controls, but in Firefox it consistently doesn't work.

I discovered this post that shows the use of an ampersand in the selector like this [@expando=value], but when I try this syntax, jQuery 1.4.2 throws an error.

Is there a cross-browser way to select expando attributes, and if so, what is the proper syntax?

View 2 Replies

Jquery - Adding An OpenID Selector Into A Content Page?

Mar 15, 2011

I would like to use the OpenID selector found here The problem is that i would like to use it in a content page, which is child of a master page.

So what modifications should i make?

I mean my master page contains the form already

<form id="form1" runat="server">
...
</form>

but so does the OpenID selector page

<form class="openid" method="post" action="/Login.xhtml?ReturnUrl=">
</form>

together with post and ReturnUrl... which is something that i need only in the login page... Right?

View 2 Replies

JQuery Xpath Selector To Select An Element Which Id Contains 'sometext'?

Jan 16, 2010

I have a listbox element in aspx page which id is attributesList.

I want to select this element to track its change event, but i cant directly select its id because asp.net changes its id on runtime.

its id, attributesList changes into ctl00_adminPlaceHolder_attributesList.

so what i want to do is to use a "contains" xpath expression to select the element.

View 1 Replies

ADO.NET :: Error - The ConnectionString Property Has Not Been Initialized

Jan 17, 2011

I have some Class A, which is data-layer in my web-application, and I'm using A's methods to accomplish Db operations. It looks like this.

[code]...

In case when my .aspx page calls 2 methods of class A during the postback, my page throws

"The ConnectionString property has not been initialized" exception for second method call.

I tried to put _sqlcon initialization into constructor, but it still throws exception.

View 5 Replies

C# - Getting Error 'Connection Property Has Not Been Initialized'?

Oct 1, 2010

I am getting error ExecuteReader: Connection property has not been initialized. below is the code i am using.

SqlDataReader oReader = new SqlDataReader();
string sSQL = @"
WITH TAB_CTE AS (
SELECT fbominum, fbompart, fparinum, flevel, fsono
FROM sodbom
WHERE fbompart= @fbompart and fsono = @fsono
UNION ALL
SELECT e.fbominum, e.fbompart, e.fparinum, e.flevel, e.fsono
FROM sodbom e
INNER JOIN TAB_CTE ecte ON ecte.fbominum = e.fparinum where e.fsono = @fsono
)
SELECT *
FROM TAB_CTE where fbompart <> @fbompart
";
SqlCommand oCommand = new SqlCommand(sSQL, this._connection);
oCommand.CommandType = System.Data.CommandType.Text;
oCommand.Parameters.Add("@fbompart", ItemSODBOM.fbompart);
oCommand.Parameters.Add("@fsono", ItemSODBOM.SONO);
oReader = oCommand.ExecuteReader();//Here I am getting error

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved