asp.net-4.0

How to set startup page for a spcific folder only?

泪湿孤枕 提交于 2019-12-11 16:32:07
问题 Below is my web application i have published... my root application(http://test.smt.com) also my root application contains a virtual dir (http://test.smt.com/console) Root Folder 1(with 1.config) Folder 2(with 2.config) Folder 3(with 3.config) Folder 4(with 4.config) // I've created this directory as virtual dir root.config Now the issue i'm getting is, directory was listing when i enter http://test.smt.com/console can we setup a start up for this particular page Folder? how? 回答1: Eureka!

Entity framework - remove related records by id

北城余情 提交于 2019-12-11 15:25:07
问题 Okay. assume I have structure: School -> students -> StudentParents <- parents -> address School can have many students, students can be relatives and have the same set of parents (may-to-many). Each parent can have multiple addresses. Assume that students who have the same set of parents cannot study in different schools. If given school_Id =5, I want to remove this school and all related records. How to do this easily in Entity Framework 4? 回答1: Answer for your question would be same as

Setting X-UA-Compatible meta tag in ASP.NET 4.0 site doesn't work

人走茶凉 提交于 2019-12-11 14:54:10
问题 As I understand it you can tell the IE8 (and I assume later versions) how to best render your page. This is useful because the page may have been designed for IE7, quirks mode or to target IE8 standards mode. As I have it, the default behaviour for IE8 when it encounters a page is to render in IE8 standards mode (not sure how it interprets the DOCTYPE though). With this default the user could change the rendering mode by clicking on the "Compatibility View" button next to the refresh button.

Calling AJAX enabled web service by POST works but with GET it always return xml

六眼飞鱼酱① 提交于 2019-12-11 13:18:14
问题 I am calling in ASP.NET 4.0 web site a web service (asmx service in same web site) method in 2 different ways. The first method succeeds and always returns a valid JSON object when the asmx web service method is decorated with [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)] . But the second method fails because the data returned is XML rather than JSON, even though I have decorated the asmx method by [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat

Differences using ajax or post back to post actions

≯℡__Kan透↙ 提交于 2019-12-11 11:37:52
问题 So my question is a little weird, as I did not learn about it (ajax approach) I just reused an original function that I encountered, renamed and tested the function. So in other different scenario (more common): A few <asp:TextBox> controls, one submit button. What is the advantage of Ajax over c# asp.net PostBack? This is the code function AppsName_AjxUpdt(CurrentColumn, recNumSplited, newValue, TBX, ActionRequest, RecordNum) { $.ajax({ type: 'POST', url: 'YourPageNameHere.aspx', data: {

Set watermark on an image and save it in an original quality

我是研究僧i 提交于 2019-12-11 11:16:54
问题 I upload a photo on web site and I want to set a watermark on it and save it in original quality. For testing I create C# application. class Class1 { public static string GetContentType(String path) { switch (Path.GetExtension(path)) { case ".bmp": return "Image/bmp"; case ".gif": return "Image/gif"; case ".jpg": return "Image/jpeg"; case ".png": return "Image/png"; default: break; } return String.Empty; } public static ImageFormat GetImageFormat(String path) { switch (Path.GetExtension(path)

AjaxControlToolKit ModalPopupExtender Drag snap back to center

时光总嘲笑我的痴心妄想 提交于 2019-12-11 11:03:06
问题 I am using ModalPopupExtender of AjaxControlToolKit 4.0 (ASP.NET 4.0), every thing working fine, when I drag ModalPopup it is dragging, but the problem is that it is snaping back to its original location(Center). The same code is working on: http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx I have search about this issue but all solutions are given by using external Java script code, but what can be the mistake on following code while the same code working

ASP.NET 4 ACCESS DATA TO APPLY TO NavigateUrl

。_饼干妹妹 提交于 2019-12-11 10:04:50
问题 I am currently learning .net and have come to a brick wall with trying to implement url rounting. I have most of it working fine, but I am trying to generate hyperlinks from information in my database. I am getting the data out fine using: 'portfolio navigation data Dim rdrPortfolioNav As SqlDataReader Dim cmdPortfolioNav As SqlCommand = New SqlCommand() cmdPortfolioNav.CommandText = "SELECT TOP 6 [id], [date], [client], [category], [title], [body], [website], [navimage], [navdesc] FROM

Keeping the Viewstate persistent and retrieve it on demand

一世执手 提交于 2019-12-11 05:24:06
问题 I've got a page with several controls, such as Checkboxlists and two containers holding search results. I've been told to make this site persistent, so the user can come back from anywhere while browsing our site and find it's settings restored (read: boxes stll checked; results still available) So far I have tried to override SavePageStateToPersistenceMedium and LoadPageStateFromPersitenceMedium, but I am constantly running into a yellow screen of death as soon, as I click a button on the

new MailMessage() Throws 'The handle is invalid'

别来无恙 提交于 2019-12-11 05:12:36
问题 Why does this code: MailMessage mm = new MailMessage(); Throw this exception: System.Security.Cryptography.CryptographicException was caught Message=The handle is invalid. Source=mscorlib StackTrace: at System.Security.SecureString.ProtectMemory() at System.Security.SecureString.InitializeSecureString(Char* value, Int32 length) at System.Security.SecureString..ctor(Char* value, Int32 length) at System.Net.UnsafeNclNativeMethods.SecureStringHelper.CreateSecureString(String plainString) at