r/ASPNET • • Jun 23 '13

ASP.NET Image load error (with custom handler)

0 Upvotes

Hi everyone,

I ran into a very annoying, and strange problem with loading pictures, using a custom handler (we need to mask the pictures runtime).

The Website, where you can check it out: website

The basics: As I stated above, I use a custom image handler for loading and modifiding images at runtime. This site offer different travels, each changed frequently (changing the price, mostly). Each hotel have an own set of pictures, where we put an "advertisement" bar on it (a semi-transparent black rectangle, with some text). This handler load the image (some from the local server, some from another URL source), and draw the needed text and pictures on it, then give back the picture itself on the Response stream.

The error: The above should work well, but strangely, the pictures itself sometimes simply dont load at all. (if you check the site on the above link, you can see it for yourself - there should be six pictures, inside a rouded bluish border). When I refresh the page, pictures appear and disappear, without any (for me) logical pattern.

I narrowed down the problem as best as I could.

But when I hit the "Refresh Image" button, the image appear as it should. When I try to acces directly the GetTestImage.ashx, it appear as it should. The load problem only appear when there is more picture boxes, with different URLs.

I simply ran out from ideas, and cant imagine why is this happening. I tried to create the most basic imageHandler (it simply load the image, create byte array, and push that to a stream toward the user). I tried different browsers, (Firefox, IE, Chrome) - all of them give the same error (or, no error, as simply the picture not showing up).

Any ideas would be really-really appreciated.


r/ASPNET • • May 08 '13

I am stuck on my project, is this the right place to ask for help?

0 Upvotes

Before I type out my quesion(s), paste code, etc etc I thought I'd ask if this is the right place to ask a question about "how do I do _______?" My question is more of a "I can't make my GridView do ______" but you get the idea.

If this is the right subreddit, great let me know. If it's not, please tell me where to go for help please? http://www.asp.net isn't really yielding much for me so far.

Thanks!


r/ASPNET • • Mar 13 '13

C# var to Java Script

0 Upvotes

got my 1st gig as a "junior" programer. We are doing a webapp for staff scheduling with ASP.net. For the interface and such the lead coder wants to use Jquery and the likes. Is it possible to pass a variable from C# to JS? The C# is doing the connection string and the likes to SQL.


r/ASPNET • • Feb 22 '13

I'm a PHP programmer with 8 years experience, learning .NET. I need advice

0 Upvotes

I'm a PHP programmer with 8 years experience. My stack when programming PHP are a LAMP stack, a console, and vim.

I am currently learning C# ASP.NET at work. There are definite advantages to it over my regular LAMP stack:

  • Strong typing

  • Linq

  • Fast, intuitive, and smart IDE (VS and Intellisense)

I want to switch from PHP to a another language. Is there an open source language that will allow me to incorporate some of these aforementioned features into my development?

I want to stay on a Linux host, so an ASP.NET / Visual Studio stack is out of the question.


r/ASPNET • • Jan 15 '13

How to fix Folder issue?

Post image
0 Upvotes

r/ASPNET • • Oct 16 '12

Commands with dependencies

Thumbnail
jefclaes.be
0 Upvotes

r/ASPNET • • Sep 28 '12

Issue when switching from classic to integrated pipeline

0 Upvotes

Hi all.

So, I've been having this issue. We recently converted our project from using a classic app pool to integrated, and have been having issues ever since.

I've changed my web.config to the best of my knowledge and when I call webmethods they don't handle exceptions properly.

This all worked in classic app pool.

Any idea what's wrong with my web.config?

<?xml version="1.0"?>
<configuration>
<configSections>
	<!--<sectionGroup name="System.web" type="System.Web.Configuration.MicrosoftWebSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">-->
	<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
		<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
			<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
			<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
				<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
			</sectionGroup>
		</sectionGroup>
	</sectionGroup>
	<sectionGroup name="devExpress">
		<section name="settings" type="DevExpress.Web.ASPxClasses.SettingsConfigurationSection, DevExpress.Web.v10.2, Version=10.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
		<section name="compression" type="DevExpress.Web.ASPxClasses.CompressionConfigurationSection, DevExpress.Web.v10.2, Version=10.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
		<section name="themes" type="DevExpress.Web.ASPxClasses.ThemesConfigurationSection, DevExpress.Web.v10.2, Version=10.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
		<section name="errors" type="DevExpress.Web.ASPxClasses.ErrorsConfigurationSection, DevExpress.Web.v10.2, Version=10.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
	</sectionGroup>
</configSections>

<devExpress>
<settings rightToLeft="false"/>
<compression enableHtmlCompression="false" enableCallbackCompression="true" enableResourceCompression="true" enableResourceMerging="false"/>
<themes enableThemesAssembly="true"/>
<errors callbackErrorRedirectUrl=""/>
</devExpress>

<appSettings>
	<add key="NAVIGATION_XML" value="navigation.xml" />
	<add key="APPLICATION_VERSION" value="1.1.0" />
	<add key="HELPFILEPARSER_XSLT" value="HelpFileParser.xslt" />
	<add key="CONSTANTS_XSLT" value="constants.xslt" />
	<add key="LEVELONES_XSLT" value="levelOnes.xslt" />
	<add key="LEVELTWOS_XSLT" value="levelTwos.xslt" />
	<add key="LEVELTHREES_XSLT" value="levelThrees.xslt" />
	<add key="Idle" value="25" />
	<add key="DBMS" value="SQLServer" />
	<add key="ProductType" value="bandl" />
	<add key="DbCmdTimeout" value="60" />
	<add key="Language" value="EN" />
	<add key="FTPLogEnabled" value="True" />
	<add key="FTPPolling" value="" />
	<add key="EmailLogEnabled" value="False" />
	<add key="EmailPolling" value="emailserver" />
	<add key="TemporaryDirectory" value="\\bfewin7\temp\" />
	<add key="SiteMinder_Header" value="" />
	<add key="SiteMinder_LoginUrl" value="" />
	<add key="LicenseSupport" value="[email protected]" />
	<add key="CustomInterface" value=""/>
	<add key="MaxHttpCollectionKeys" value="10000" />
	<add key="TraceEnabled" value="True" />
</appSettings>

<connectionStrings>
         ...working connection strings in here	
    </connectionStrings>

<system.web>
	<pages enableEventValidation="false">
		<controls>
			<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
			<add tagPrefix="ajaxToolKit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
			<add tagPrefix="bl" src="~/ui/assets/ascx/PageNavigator.ascx" tagName="PageNavigator"/>
			<add tagPrefix="bl" src="~/ui/assets/ascx/RegexBuilder.ascx" tagName="RegexBuilder"/>
			<add tagPrefix="bl" src="~/ui/assets/ascx/MessageBox.ascx" tagName="MessageBox"/>
			<add tagPrefix="bl" src="~/ui/assets/ascx/ComboBox.ascx" tagName="ComboBox"/>
			<add tagPrefix="bl" src="~/ui/assets/ascx/ErrorBox.ascx" tagName="ErrorBox"/>
			<add tagPrefix="bl" src="~/ui/assets/ascx/TabGroup.ascx" tagName="TabGroup"/>
		</controls>
		<tagMapping>
			<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0" />
			<add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0" />
			<add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0" />
			<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0" />
			<add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0" />
			<add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0" />
		</tagMapping>
	</pages>

<compilation debug="false" defaultLanguage="c#">
		<assemblies>
			<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
			<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
			<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.Runtime.Serialization.Formatters.Soap, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
			<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
			<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
			<add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			<add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

			<add assembly="DevExpress.Data.v10.2, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
			<add assembly="DevExpress.Utils.v10.2, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
			<add assembly="DevExpress.Charts.v10.2.Core, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
			<add assembly="DevExpress.XtraCharts.v10.2, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
			<add assembly="DevExpress.PivotGrid.v10.2.Core, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
			<add assembly="DevExpress.XtraPivotGrid.v10.2, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
			<add assembly="DevExpress.XtraReports.v10.2, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
			<add assembly="DevExpress.XtraRichEdit.v10.2, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
			<add assembly="DevExpress.RichEdit.v10.2.Core, Version=10.2.5.0, Culture=Neutral, PublicKeyToken=b88d1754d700e49a"/>
		</assemblies>
	</compilation>
<authentication mode="Forms">
  <forms name="VerticesAuthorization" loginUrl="~/UI/Login.aspx" protection="All" path="/" timeout="30" slidingExpiration="true"/>
</authentication>
<authorization>
  <deny users="?"/>
  <allow users="*"/>
</authorization>
<customErrors mode="Off"/>
	<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="auto" uiCulture="auto" />
	<!--allow users to upload files up to 8 megs-->
	<httpRuntime maxRequestLength="8192" />
	<!-- allow users to have access to the include folder in order for the CSS to work when user is not authenticated-->
</system.web>

<location path="UI/includes">
<system.web>
  <authorization>
    <allow users="*"/>
  </authorization>
</system.web>

</location>

<location path="UI/img">
<system.web>
  <authorization>
    <allow users="*"/>
  </authorization>
</system.web>

</location>

<system.webServer>
	<validation validateIntegratedModeConfiguration="false" />
	<modules>
		<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
		<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v10.2, Version=10.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule"/>
	</modules>
<handlers>
  <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>
<system.web.extensions>
	<scripting>
		<webServices>
			<jsonSerialization maxJsonLength="50000000"/>
		</webServices>
	</scripting>
</system.web.extensions>
</configuration>

I'm happy to provide more code or any examples, just ask. I'm pretty sure the problem exists in the web.config though.


r/ASPNET • • Sep 21 '12

A great blog post: A Successful Git Branching Model.

Thumbnail
nvie.com
0 Upvotes

r/ASPNET • • Sep 02 '12

Supporting the OPTIONS verb in ASP.NET Web API

Thumbnail
jefclaes.be
0 Upvotes

r/ASPNET • • Jul 16 '12

8 Step VB Scheduler Tutorial

Thumbnail
blog.scheduler-net.com
0 Upvotes

r/ASPNET • • Jul 15 '12

Dear Microsoft, Please Include Web Deployment Projects in Visual Studio 2012

Thumbnail
diaryofaninja.com
0 Upvotes

r/ASPNET • • Jun 27 '12

DHTMLX Scheduler .NET in Visual Basic

Thumbnail
blog.scheduler-net.com
0 Upvotes

r/ASPNET • • Jun 18 '12

Server Intellect announces ASP.NET MVC 4.0 BETA Public Cloud Hosting

Thumbnail
serverintellect.com
0 Upvotes

r/ASPNET • • May 18 '12

What is a professional website menu?

Thumbnail
apnsoft.com
0 Upvotes

r/ASPNET • • Apr 27 '12

EntityDataSource incapable of handling table relationships/joins?

0 Upvotes

I'll be honest here. I'm completely new to ASP.NET and web development in general but I've come so far through so many random compiler errors, dodgy code, fucking SQL version problems and utter nonsense unhandled exceptions with no useful information that I'll be damned if I can't get something that seems so simple to work.

I'm doing a web dev course at the moment and I've been hacking a copy of Tailspin Spyworks into my own website (terrible, I know but the teacher says its ok and besides the course only goes for 20 weeks with about 9 hours per week and I'm the only one in the class so I get very little one-on-one time with the teacher).

I've got a basic understanding of databases and I've got a one-to-many relationship with two tables - PlantInfo and Products. The PlantInfo table holds rows with a primary key (InfoID), PlantType (decorative or crop), PlantSeason and PlantMaintenanceLevel. The rows in the Products table have your typical columns (such as ProductID, CategoryID, Description, Cost, etc) as well as an InfoID column so if I have three different kinds of plants that all grow in Spring, are Low maintenance and are a decorative type of plant they will all have the same InfoID all pointing to the same row in the PlantInfo table.

Now for the problem. I've got this file http://pastebin.com/DTA4D7ks, ProductList.aspx (please note - the code behind .cs file is essentially empty). This page works great if you want to query (from the URL) the ProductID or the CategoryID or InfoID of rows in my Products table but I just can't seem to work out how to make the asp:EntityDataSource tag to allow me to do a query (from the URL) of my PlantInfo table for specific listings and then join the InfoID retrieved with products from my Products table with matching InfoID's. The asp:EntityDataSource tag will only allow me to query rows from one Table and it seemingly doesn't give any way to make use of the relationships between your tables (to either query data in the related table or to display it on the page).

The only solution I can think of is to ditch this EntityDataSource thing altogether and just write some code to QueryString the URL for whichever parameters I desire and run SQL queries to match/contain whatever I please from the two tables and then join the two tables together. This seems like the simplest way but apparently code-behind is "bad" and should be avoided. Another simple solution is just to keep all the data (PlantType, PlantMaintenanceLevel and PlantSeason) in the Products table but I've got different types of Products like soils, pots and gardening tools where that sort of stuff doesn't really apply.

I know this post sucks and isn't very descriptive but I've gotten this far without completely losing my sanity. I've tried just about every combination of google search keywords I could think of for at least a solid 3, maybe 4 hours and I'm still stumped.

Edit: Here's an image showing the columns for the tables I've been talking about and a join query of the two tables. http://i.imgur.com/zkgKK.png

After Catalyzm's comment I looked at LINQ queries and it pretty much looks like what I'm after. I think I've been trying to fit a square peg in a round hole with this asp EntityDataSource tag. I'll try and get it working on the weekend and I'll report back on how it goes.

Edit 2: It would appear LINQ is dependant on SQL which would appear to needlessly increase the complexity of the issue I'm having.


r/ASPNET • • Apr 15 '12

can't get hyper link working in grid view control

0 Upvotes

For a project I am trying to use a hyper link field inside of an access 2010 database, which is being called upon by setting the database as a datasource and putting it into a grid view. it doesn't come up with an error but it shows the hyper link as #link# so it is not click able which is the main problem as I am trying to get it so when you click the title it redirects to a seperate web page.


r/ASPNET • • Apr 12 '12

Had a question about design patterns in relation to ASP.NET. Can someone describe what is a design pattern and how is it implemented or used in ASP.NET?

0 Upvotes

I do freelancing web development work on the side using ASP.NET C# and SQL Server 2008. Recently I saw someone mention design patterns being used in developing websites. I don't recall where it was but I would like to learn more about design patterns and how to use it while developing websites in ASP.NET.

Can please someone shed some light on this matter? It would be very helpful of you. Thanks


r/ASPNET • • Mar 03 '12

All I want is ASP .NET style front end with Active Record style backend.

0 Upvotes

I feel like I'm missing something because it seems to me that ASP .NET Webforms follows the MVC architecture better than ASP .NET MVC.

In any case, I really like ASP .NET webforms + AJAX package. It seems to make everything so much easier to build and create reusable components with.

But I hate it's backend. I'm too stupid and lazy to use SQL. I want to add "MVC" style models to ASP .NET webforms where the tables are mapped to first class classes and objects with minimal effort.

Are there any libraries that do this. Or is there a way to somehow merge ASP .NET MVC backend with ASP .NET webforms?


r/ASPNET • • Feb 03 '12

What are some arguments for going with MVC over WebForms for new projects?

0 Upvotes

In a lot of ways, this is the inverse of the MVC to WebForms thread (http://www.reddit.com/r/ASPNET/comments/p6unv/my_boss_wants_to_go_backwards_from_mvc_back_to/) but we have an opportunity to rewrite our product in a couple months and I want us to switch to MVC.

One issue I am having though is convincing people why it's better to switch. They see the benefits but they don't see significant enough benefits over a well designed WebForms application. While that's true to a certain extent, I think MVC is still the better choice in the long term even if there are no significant benetifs in the short term.

So fellow devs, what would you do in this situation? What are your arguments for going with MVC over WebForms? And the more specific you can be, the better.


r/ASPNET • • Nov 15 '11

MapDotNet progress bar

0 Upvotes

Hi, this is my first post here.

Is anyone familiar with MapDotNet and can offer me some help? I'm trying to put a progress bar that loads every time a new layer is loaded. The problem is that layers are loaded asynchronously, so the progress bar doesn't even show up.

Anyone familiar with MapDotNet?

Edit: That was quick, I actually figured it out.

For anyone interested:

        #region ICommandTarget Members

    /// <summary>
    /// Gets the command bindings.
    /// </summary>
    public List<CommandBinding> CommandBindings
    {
        get
        {
            if (_CommandBindings == null)
            {
                _CommandBindings = new List<CommandBinding>();
            }
            return _CommandBindings;
        }
    }
    private List<CommandBinding> _CommandBindings;

    /// <summary>
    /// Gets the routing parent.
    /// </summary>
    public ICommandTarget RoutingParent
    {
        get { return (Parent as ICommandTarget); }
    }

    #endregion

put this after you initialize your components:

        myMap.RoutedCommandTarget = this;

        CommandBinding gettingTiles = new CommandBinding(MapView.QuadTileLoadingQueueHasNewEntriesCommand);
        gettingTiles.Executed += (s, te) =>
        {
            MapProgressBar.Visibility = Visibility.Visible;
        };
        CommandBindings.Add(gettingTiles);

        CommandBinding doneGettingTiles = new CommandBinding(MapView.QuadTileLoadingQueueHasEmptiedCommand);
        doneGettingTiles.Executed += (s, te) =>
        {
            MapProgressBar.Visibility = Visibility.Collapsed;
        };
        CommandBindings.Add(doneGettingTiles);

r/ASPNET • • Sep 26 '11

Modify web.config doesn't work on server machine

0 Upvotes

Hi. This is my first post in asp.net.

I am using code to modify web.config connectionstring programmatically:

string dummyVirtualPath = "/MyApp"; string physicalPath = @"" + configPath;

            WebConfigurationFileMap map = new WebConfigurationFileMap();
            map.VirtualDirectories.Add(dummyVirtualPath, new VirtualDirectoryMapping(physicalPath, true));
           
            var configuration = System.Web.Configuration.WebConfigurationManager.OpenMappedWebConfiguration(map, dummyVirtualPath);

            /*var configuration = WebConfigurationManager.OpenWebConfiguration(configPath);*/
            var section = (ConnectionStringsSection)configuration.GetSection("connectionStrings");
            section.ConnectionStrings["ConnectionString"].ConnectionString = "Data Source=" + host + ";Trusted_Connection=false;User ID=" + username + ";Password=" + password + ";MultipleActiveResultSets=true;Initial Catalog=" + database + "";
            configuration.Save();

This methode works flawlessly on developer machine. It doesn't work on server machine.

I set million permissions to IUSR, IIS/IUSR, NETWORK SERVICE ... etc etc.. to web.config, whole wwwroot lol etc, I am desperate don't know what to do anymore :)

I want to mention, that I can't debug on remote server, because I use web developer express(its school project).

I used javascript alerts to see when it drops out and it happens after this code: var configuration = System.Web.Configuration.WebConfigurationManager.OpenMappedWebConfiguration(map, dummyVirtualPath);

Thanks to anyone who will atleast click this hehe. Byeee


r/ASPNET • • Aug 29 '11

Async long running connections with SignalR (x-post from \r\programming)

Thumbnail
hanselman.com
0 Upvotes

r/ASPNET • • Aug 18 '11

ASP.net / C# book for beginner? Preferably something that will help me develop a social media type page.

0 Upvotes

I've worked with Java, C/C++, Ada, and HTML/CSS. My buddy told me he can get me in at a place that does social media and e-commerce type stuff. Only condition is that I have to be semi-functional (sounds fair). Anyway, ASP/C#/Visual Studio looks like a hot mess of mishmashed Microsoft stuff. I'm coming from a Linux background and I don't even know how to get started (besides downloading and installing). Any suggested books? Tutorials?


r/ASPNET • • Jul 07 '11

Understanding ASP.NET MVC Model Binding

Thumbnail dotnetslackers.com
0 Upvotes

r/ASPNET • • Jun 07 '11

Why are so many ASP.NET developers weak at DOM/CSS and Javascript stuff?

0 Upvotes

I am not generalizing on all of you, but all the ASP.NET developers I have seen so far are very pathetic at Javascript and understanding CSS/DOM. They are just weak or very ignorant to learn it. I wonder if this has to do with all the tools that MS provides for .NET developers.

On the other hand, the PHP developers I have come across are always good at understanding Javascript, CSS/DOM stuff.

Just my experience.