I have an xsd that describes XHTML documents. However the application I'm working with may have some selected asp.net controls within to the markup at the point is validated. Therefore the validation fails.
An example control could be:
<smart:Address runat="server" />
I wanted to add a new element to the xsd file but when I specify:
<xs:element name="smart:Address">
I get validation errors as an element name must not have a colon in it.
how I might be able to extend the schema file to allow selected server controls?
I'm currently creating a small web app that requires users to log in before accessing any features.
I'm using Visual Web Developer 2010 and I have created a database in the App_Data folder of my project that I now wish to add the required tables, views and stored procedures to in order to use the SqlMembershipProvider. I have ran the aspnet_regsql file and entered the required details and completed all the required steps; however, when I return to Visual Web Developer and refresh the database I created, nothing happens, there are no tables or stored procedures.
Although nothing has been added to the database in my project, when I open up SQL Server Management Studio, my database appears with all the relevant tables, views etc.
Is there any reason why the database with all the required tables etc appears in SQL Server Management Studio but not in my project in Visual Web Developer?
I'm getting rather confused as I have completed this before on another project on a different machine and it worked fine.
You're using NHibernate with Fluent NHibernate for mappings.
You have an application in production with a database with live data You're adding a new feature in development and it requires a new database column.
The new column cannot be blank. For example, I recently had to a DateCreated column to a table and the app now uses that date. As the only time the data will be missing is now, it seems unnecessary to add code to check for errors.
In my application I have an updater which can execute a SchemaUpdate to add the new database column - however, the application will starting crashing as it is expecting a value in the new column.
I need to get some sensible default data into that column. In this case I manually ran an Update to set the date to the current date (good enough for the situation). In this particular case I believe that you cannot set the column default to getdate() using fluent mappings.
Keep a schema version number in a config file In the updater that runs SchemaUpdate start adding upgrade methods for each version. These methods would run updates to add default data (or other required actions).
After the schema update has been run, call all methods required for a version greater than the current version (i.e. those that haven't previously been run). So if the app is now version 4 and version 2 is installed, methods 3 and 4 would be run.
Is there a way to apply your own CSS tags to <li> tags when using ASP .NET 4.0 menu control? For example, say I have an external style sheet that has tags "class1", "class2", "class3", and etc. I want to apply "class1" to the first menu item. Then if menu item is selected, I want to apply "class2" and if it's not selected, "class3". I played with various 'Static' styles, but just can't get it work. I finally gave up and created my own menu control that extends ASP .NET menu control and provides my own custom rendering. This works, but I'm wondering if there is a way to get it work with built-in menu control.
I think I need something like this after my last line from above:
Col1=first TEXT width 150
My text file has 7 columns, the first row is the header row. The data comes from a Micosoft SQL Server Database where the fields are of the following types:
I have this food recipe asp.net c# application I'm working on and I would like to be able to insert a list of tags into the database for each recipe. So let's say I have three tags (southern, cajun, gumbo) that correspond to a gumbo recipe. How would I insert these three tags into the database from the UI? Would I store them in a List, run a foreach, and insert each tag individually? I'd really like to be able to somehow use a stored procedure to do this.
protected void Page_Load(object sender, EventArgs e) { DataSet.DestinationsDataTable GetDestinations = (DataSet.DestinationsDataTable)dta.GetData();[code]....And it's returning this error (on a content page)The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
I programatically add meta tags to the head of each page using htmlhead, specifying the name and content. I now need to add new meta tags with property and content.
I am generating xhtml in code that is then inserted into the page. Are there class(es) that help with adding tags etc. Then having a function that will output it to a string. (like the xml dom api) code like:
I have been thinking about the optimal way to create an XML file using data from a Dataset AND according to the rules of an XML schema. I've been searching around for a bit, and I failed to find a way in which I only take the data from the Dataset and put it inside a XML tags, with the tags being defined by an already-existing schema. So it might go like this:
1- Create Dataset and fill its rows with data. 2- Create an XML according to an XML schema rules. 3- Fill said XML file with data from Dataset such that data is taken from the Dataset while structure of the XML file is taken from the XML schema.
I have a SQL Server 2008 DB with many tables filled with data and I used SQL Server Management Studio to generate a SQL dump by using the Script Wizard : Tasks -> Generate Scripts -> Script All objects in the selected database and also selecting the option to Script Data. I made sure to change the value of "Script for Server Version" to "SQL Server 2008". Then I created a new DB and ran the SQL dump on the new DB to generate an identical copy of the old DB. Then I assigned permissions to my default user to the new DB. Then I changed the connection string on my ASP.NET application to use the new DB. But when I run it, it throws the following exception -
Server Error in '/myapp' Application. The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Configuration.Provider.ProviderException: The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:.........................
I want to add picture to my SQL database using file Upload control but I don't know which attribute should I use also I don't know how to add it in the stored procedure,
I need to add Meta tags, description and keywords in aspx page. My aspx pages are in master page and I have already added meta tags and description in my Master Page.
Now I want add in my other pages also so if someone search my site on GOOGLE it should look like same as this:
So I'm writing an app that lets the user select a folder, it gets all the .aspx files in that folder, and lets the users check off which ones they want to add HTML ID's to.
Then they click start, and this runs
private void btnStart_Click(object sender, EventArgs e) { for (int i = 0; i < listFiles.CheckedItems.Count; i++) { } }
It loops through all the selected file names. How do I open each of these .aspx files in the background, and go through them and add the id="thisItemId"
i have created a aspx page with the script manager, update panels and so on. Now, when i use some jquery functions which are included inside the head tags, when the page is run, i find the script tags generated inside the body instead of the head tag. i'm using visual studio 2005 only.
I am building a forum and I want to use forum-style tags to let the users format their posts in a limited fashion.Currently I am using Regex to do this.As per this question:How to use C# regular expressions to emulate forum tags. The problem with this,is that the regex does not distinguish between nested tags.Here is a sample of how I implemented this method:
public static string MyExtensionMethod(this string text){return TransformTags(text);} private static string TransformTags(string input) {string regex = @"[([^=]+)[=x22']*(S*?)['x22]*](.+?)[/(1)]"; MatchCollection matches = new Regex(regex).Matches(input); for (int i = 0; i < matches.Count; i++) var tag = matches[i].Groups[1].Value; var optionalValue = matches[i].Groups[2].Value; var content = matches[i].Groups[3].Value; Now,if I submit something like [quote] This user posted [quote] blah [/quote] [/quote] it does not properly detect the nested quote.Instead it takes the first opening quote tag and puts it with the first closing quote tag.Do you guys recommend any solutions?Can the regex be modified to grab nested tags?Maybe I shouldn't use regex for this?
I work in VS 2008. Whenver I add a server control(Label) and set it properties in aspx.vb and build the solution, I get the error "Label1 not declared". While analyzing this issue I noticed that the event handler statements for the Label1 where not added in the designer.asp.vb file. These statement would actually be added automatically when I drag and drop a control to my webpage.
I would also like to inform the scenario after which this problem came to me. I was working in VS 2008 , VS 2005 and VS 2003 in the same machine.Could this have caused the issue ?
Now each and everytime when I add a control, I am adding the "With Events" code in the designer page to make my build succesfull which makes me to spend more efforts.
Just wondering what the best approach is to labelling ID's (thats html id's) in .net.
For instance I may have a user control that is embedded in a page more than once. If I have a standard html div in the control with id="my-user-control", then it will duplicated when the page is built.
So what is the best approach for styling your html within user controls, master pages and .net in general?
I m trying to read the tags of a local HTML file. I found out this code online but it works for the aspx pages on the server and of the current app only. ___________________________________________________
using System.Web.UI.HtmlControls;
foreach (Control c in this.Page.Header.Controls)
{ if (c.GetType() == typeof(HtmlMeta))[code]...
THis code acceses the following section of an html page -