Dynamic Content Switching Based On Stylesheet?

Aug 16, 2010

I'm making a new design for my website, but I want to keep the old one and possibly switch between the two.

Unfortunately, I've changed the content on the Master Page (luckily I have a backup).What I was thinking was to keep separate master files for each theme, and then just determine which one to server based on which stylesheet is loaded.

The only way I can think to do this is to keep a "settings" file on the website that has a "stylesheet=1/2/3/4/etc" line. Depending on the number there, the server will serve the correct master page.

Alternatively it might be easier to do something similar, but instead of serving a whole different master page, set a specific stylesheet to use.In both cases, I need a little help with actually doing the work on the server. I can read a text file (even encrypt/decrypt a file before and after it gets read for security), but actually giving the server the instructions based on what is read is where I'm lost.

View 2 Replies


ADVERTISEMENT

Localization - Do SEs Consider It Duplicate Content If URL Doesn't Change When Switching Languages

Jan 27, 2012

I have my company's website (Visual Studio / vb / asp.net 4.0) localized in 9 different languages, and they all work great. When you're on, for instance, about.aspx, and you switch to Russian or Swedish, it stays on about.aspx and doesn't add a query-string to the end of the URL; it just changes the page's text to that language. Will the major SEs like Google, Yahoo, etc., consider this duplicate content for SEO purposes and if so, what should I do?

View 3 Replies

Dynamic LINQ Query Based On Dynamic Number Of Comboboxes?

Feb 5, 2010

I would like to bind a DataGridView to a different LINQ query every time (in order to reuse the same form/DGV for different queries), like this:

[Code]....

but the "Qry", and the number of comboboxes, and their field names would change every time.

View 5 Replies

VS 2010 Create PDF With Dynamic Content?

Jan 20, 2012

I'm looking for a way to create PDF with dynamic content. When you google for it, you get 1000 hits on how to dynamicly create PDF's, but thats not what I mean.

View 6 Replies

Accessing Dynamic JavaScript Content From Onclick?

Dec 28, 2009

I have read previous posts and used suggestions about firebug and selenium etc. I am still a newbie and am still pretty confused as how to implement this. I am trying to access URLs that appear when I click on a link. I have accessed the JavaScript code and the function just has a couple of parameters which I have no idea how to intercept using vb.net or C# etc.

View 2 Replies

Create Dynamic Content Flash Object On Fly Using ASP.Net?

Feb 13, 2012

How to create an aspx page with a Flash object inside? And how to change the content of the Flash object?[code]...

View 1 Replies

Perform An Action Based On The Content Of A Contextmenustrip

Mar 21, 2009

My app pulls news stories from my website and dumps them in a contextmenustrip. If for some reason they can't be gotten, then a refreshbutton appears instead.I'm using this code to perform an action based on the content of a contextmenustrip. But how do 'override' the default to allow for the 'refresh' option? ie - would should I put here -->

[code]...

View 4 Replies

Populating A Menu Based Off Of The Content Of A Folder

Jun 10, 2011

I've been trying to figure out the easiest way to populate a menu to allow for easy updating in the future. I would like to add anything to a specific folder and when the program runs it would be populated by the contents of the specific folder. Is this possible? What should I look into to do this? Not sure of the process to use to do this, that is if it is even possible.

View 8 Replies

Deleting Item From TXT File Based On ListBox Content

Jan 23, 2012

I am trying to delete an item from a text file based on if an item appears in a listbox but keep getting an error " Index was out of range. Must be non-negative and less than the size of the collection." The line it is returning the error on is the the first IF statement of the below text.

Code:
Dim Lines As new List(Of String) (IO.File.ReadAllLines("Carl.txt"))
For i As Integer = 0 To Lines.Count -1
If Lines(i).Contains (listBox1.text) Then
Lines.RemoveAt(i)
End If
Next
IO.File.WriteAllLines("carl.txt", Lines.ToArray)
End If

View 1 Replies

.net - Replace Content In A String Based On Regex.Matches MatchCollection?

Mar 5, 2009

I've been working on this RegEx for the past day or so and I think I have it worked out so that it returns the data I want. First a little background.I have a content editor that users will be able to edit web pages. They can format text, add links, etc.. standard content editor stuff. When they click save, the editor provides the ability to get the content (editor.Content) and put it into a string. What I want to do is get any links (<a> tags) and find out if they are internal or external links and if they are PDF files.

Here is the Expression I've come up with:

<a[^<>]*hrefs*=s*[""'](?<domain>https?://[^/s'""]*)*/?(?<path>/?[^s""]+?)?[[>""']

With this, I am able to separate the domain (if it has one) and the path out. Then, I loop through the matches...

dim matchColl as MatchCollection = Regex.Matches(editorContent, regExString)
For Each m as Match in matchColl
If m.Groups("domain").value <> myInternalDomain and m.Groups("domain").value <> "" then
'this is an external domain... do some stuff

[code]....

My question is this... the parts where I 'do some stuff' to the values, what would be the best way to get that back into my 'editorContent' string? I could probably put the editorContent into a StringBuilder and do a whole bunch of replaces on it, but is that very efficient?So, for example, with the PDF, I want to specify that it open in a new window (target="_blank") and for the external URL, add some javascript code into the onclick attribute.

View 1 Replies

C# - Build Dynamic Clothing-based Website?

Nov 10, 2010

For comparison: something like the shirt builder application at [URL]Say, if I have fabric image and want to generate base, collar, cuff etc. How should I do it on server side in .NET, and generate different components of shirt.

View 1 Replies

Creating Dynamic Array Based On SQL Count?

Sep 15, 2009

I have a SQL database which I'm running a query against to return a list of names - eg using "select names from table"I would like to add all of these names to an array so I can use them later. To do this I would need to use a dynamic array as the number of names returned could be anything.Apart from first running "select count(names) from table", getting a value and then Redim'ing the array on the count is there another method I can use.I've seen there's a dataset row.count? Can I somehow use this?

connection.Open()
reader = command.ExecuteReader()
While reader.Read()

[code]....

View 5 Replies

Dynamic String Trimming Based On Character?

Jun 2, 2011

I have an array filled with values from Excel cells. Each of the values is a concatenation of two things separated by a pipe, like "Machines|MachinesCode"

I need to, as I fill this array, strip out the pipe and everything in front of it so that the array being filled is only filled with the "MachinesCode" part of the cell value, but I haven't had much luck finding how I should do this. Each cell is dynamically filled and will never have a set length, so I can't set a trip by a particular number value of characters in the strings.

This subroutine is what I'm using. I am filling array FieldArray with another array (ExcelArray) currently holding the concatenated values.

Public Shared Sub PopulateFieldArray(ByRef FieldArray() As String, ByVal iFieldCount As Integer, ByVal ExcelArray(,) As Object)
Dim iIndex As Integer
For iIndex = 1 To iFieldCount
FieldArray(iIndex) = CStr(ExcelArray(2, iIndex))
Next
End Sub

But I don't know what to wrap around the CStr Excel array to cut off the pipe and all values before it while I fill FieldArray.

View 5 Replies

Move Dynamic Picturebox Based On Context?

Nov 9, 2011

When i press W, i'm creating a dynamic picturebox of a bullet but i have no clue how to make it move to the target.I can create myself a picturebox and call it picBullet1, but what about bullet 2, 3,4 etc? what should i read/learn?

View 3 Replies

Sql - Dynamic Dropdown Based On Radio Selection

Nov 2, 2009

We have a GUI that displays a radio selection box (3 options) that are the three sites where our hospitals are. We need to dropdown located on the form to fill with only the locations based on the selected radio option.

Here is the code behind we have so far (sorry, VB)

[Code]....

For the record the Location dropdown is currently databound but its a static SELECT statement which brings us all the locations but we'd prefer it to be cleaner if it only returned the locations based on Site. We are using Visual Basic 2008 Express Edition for development.

View 2 Replies

VS 2008 Set A Dynamic Array Based On Own Structure?

Jul 20, 2009

ArrayList is a generic structure. Let's say I have my own structure (contained of Boolean+string+int). I want to set a dynamic array based on my own structure. How....?

View 9 Replies

Dynamic Page Based On Querystring With Friendly Urls

Mar 10, 2011

Essentially what I want to do is have a few pages that act as templates for data. If a url is url... I want to query a friendly url field for "/home" which would return url...

View 1 Replies

ASP.NET Creating Dynamic Order Reference Based On Database Id?

Aug 5, 2011

I am looking to create an order reference which is something like this

PLC0000001

Where the 1 would be my order id

but lets say it gets to 100 would like

PLC0000100

In VB.NET how could I build up a string like where i know i.e.

the starting part = PLC
Ending part = Order ID
middle = fill in 0's

View 2 Replies

Dynamic - Changing The Value In A Different Text Boxes With 1 Function Based On Name?

Jan 1, 2012

I have done this in Php with a function before. I just don't know how to do it in VB.I have a character sheet creator for a game I am making. What I am wanting to do is write a single function, where in you click on a button and it will pass the text box name (so that it knows which text box to edit), as well as the value inside of the text box (to make sure that the new character stat ceiling is taken into account).

Private Sub Button_Click
AddtoValue(Textbox1,stats)
End Sub[code].....

Essentially, I need to know what to put for noidea, and noidea2, like, byval or byref or what?

View 3 Replies

Setup A Datagridview That Is Dynamic Based On User Input?

Feb 11, 2009

I am attempting to set up a datagridview that is dynamic based on user input. The user input is a start and end date. The start date defines the first column the next column is the next date... until the end date (x-axis). The y-axis is technicians and the fields will show the assignment for the technician on that date.

All the advise I am seeing on datagridviews is to create a property methods to provide the information for each column. for example:

Dim 12-Oct-2009 as string
Dim 13-Oct-2009 as string

[Code]...

How do I create a object data source that allows me to populate the data grid? I want the column headers to be included as a string in row 0 of the multidimensional array. The amount of columns will be dynamic with a minimum of 1 and maximum viewing of 100 days based on what dates are selected in the start date and end date fields.The input dates will be used to generate a query to a database that will populate the multidimensional array.One solution I see is pick a start date and have a set number of dates and code for set number of columns (100) in a row and then set the names of the columns dynamically...ahhhh code repetition!

I am not sure how else to do this but looking for a more suttle way.I am using this to create a simple scheduling tool to see resource schedules by date. There is an unmoveable end date so initially I will need to look ahead 100 days but as the end date gets closer, I will have fewer and fewer dates. So eventually the end date will be that start date.

View 3 Replies

Add Dynamic ASP.NET User Controls BASED ON ViewState / BUT Before LoadViewState Phase

Jan 27, 2011

My page has a drop down whose values are dynamically populated. Based on which item is selected, a number of TextBoxes are dynamically created during runtime.The user then fills in information into the textboxes and clicks a submit button.After postback from the submit button, I need to again dynamically create the TextBoxes during Page_Init (BEFORE LoadViewState) so that after the ViewState loads, my Button_Click event can save/do whatever with the user input. PROBLEM is, I cannot recreate the textboxes based on the selection in the dropdown, because the dropdown hasn't been "selected" yet by LoadViewState.SO, how can I read from the view state, create my textboxes, then let the viewstate populate the textboxes, and then the Button_Click will use the values??The one thing I've attempted is to override the LoadViewState function so that I can read from the view state, create the boxes, and then load the viewstate again. This did NOT work, because the debugger never seemed to hit my overridden function.[code]

View 1 Replies

Dynamic Sql Table Creation - Create Sql Tables Based On User Need

Apr 20, 2012

i need to create sql tables based on user needs lets say a guy needs a table of 4 rows 5 columns other user needs 3 rows 3 columns each with different types so how is the best way for letting them choose like they write in a text box ( this will be the value of rows)4 and another text bvox the count of columns and i have those 2( rows and columns needed) numbers i create the table as is.based on those. by default i create type as varchar max then later on we must fill the table using datagrid.

View 14 Replies

Reload Page Data Based On Dynamic DropdownList Selected Value

Oct 26, 2011

I have a bit of a tricky scenario. It consists of some partial problems for which I have individually found solutions, but I couldn't find anything that makes it all work together smoothly.

-Upon selecting an item in a datagrid, a new page loads with the details regarding that entity.
-The entity represents a product that can have any amount of variants (such as a t-shirt's color or size)
-I dynamically add dropdownlists to this detail-page that represent these variants (there can be any amount of variants, and each variant can have any amount of different values, each value or combination or values from different variants representing a unique product entity)
-Upon selecting a different variant in a dropdown, a delegate is called that will change the session variable to the productId associated with the selected variant and a postback is fired that will reload the page with new data based on this productId

The problem: the postback is fired BEFORE the dropdownlist's (OnSelectedIndexChanged) delegate is called. Since this delegate defines the productId in the session, the new to-be-used productId isn't known at the time of postback.

Result: loading the correct data in the page is always delayed by one postback. Each time I change the selected index of any of the dropdowns, the page is loaded with data based on the session variable that the PREVIOUS OnSelectedIndexChanged delegate of the dropdown set.

I have a LoadData() method that sets the values of all textboxes, fields, labels etc. based on the productId stored in the current session. This method is called on Page_Load.
Private Property CurrentProduct As Product
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
LoadData()
[Code] .....

It seems that I haven't been completely clear on what does and doesn't apply to this scenario regarding Page Lifecycle.

1) My dropdownlists are added dynamically, which works fine on the first page_load.
2) The content of the dropdownlists is defined by what entity's details i'm loading on the page.
3) What entity's details I'm loading on the page is at first(not-postback) defined by the product I selected in a gridview in the previous page.
4) At postback, this entity is based on a sessionvariable containing the id of the entity.
5) This session variable is defined by what item in the dropdownlist I select.
6) This dropdownlist dissapears after postback since it's not defined on the page, but dynamically. So is the event.

So my guess would go towards some clientside script that stored the selected value before postback, but then I would be clueless on how to get that variable to the server since the logic that retrieves the entity is in the business logic layer which is far away from this page..

View 3 Replies

Create Dynamic Buttons At Run Time Based On Database Records And Implement Events For Them

May 11, 2010

I have to create buttons at rum time based on database records and implement their events.

View 5 Replies

Conditional Stylesheet Css?

Apr 29, 2012

The template I use for all of my pages looks at the style.css to get the header image. I want to change it so that it looks at who logs in and displays an image based on who they are.

View 3 Replies

Css - Attach A Stylesheet?

Nov 23, 2010

How do I attach a stylesheet? I've tried the usual way:

<LINK REL=StyleSheet HREF="../../Content/Site.css" TYPE="text/css" MEDIA=screen>

with various file paths. I've also tried with vb url.content scripts.For some reason nothing I try is displayed in the browser.I get various results:

stylesheet cannot be found

sometimes firebug only shows the html written

What else could be the problem?

Its attached to the master file, so i dont know what else is wrong here.

View 3 Replies

Stylesheet Not Working MVC?

Nov 11, 2009

My stylesheet wont load for my master page. Any ideas why?

<html xmlns="http:www.w3.org/1999/xhtml" >
<head runat="server">
<link href="StyleSheet1.css" rel="stylesheet" type="text/css" runat="server" />

[code].....

View 3 Replies

Unable To Use Stylesheet In VB

May 17, 2010

I want use stylesheet in vb

View 2 Replies

Using XSL Stylesheet To Export Data To Excel?

Jun 17, 2009

I'm using an xsl stylesheet to export data to excel. In the xsl file I have coded to put protection on the worksheet. When the excel file opens, if I check under Tools - Protection, it appears that the protection was set, but I am still allowed to select and update cells in the worksheet. If I turn the protection off and then turn it back on, it is applied as expected. Has anyone had this type of situation where the xsl sheet appears to be applied correctly, but the proctection that was applied doesn't work?

View 1 Replies

Auto-size Datagridview Width Based On Content Width?

Nov 26, 2011

What I am trying to do is fill the contents of the datagridview with the cell contents. There are two ways to do this.

1) Either set the DGV width to the cell contents width, or

2) Autoadjust the width of the cells to the width of the DGV.

how to implement either of these two approaches?

View 3 Replies







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