You can replace all commas with this little script by the aid of regular expressions
<script>
var s = '133,123,123.00';
var replacedText = s.replace(/,/g,'_');
document.write(replacedText);
</script>
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
If you hava a javascript like this:
1 <script language="javascript" type="text/javascript">
2 window.status ='some text';
3 </script>
You will see firefox is not showing "some text" in the status bar. Too see your text you must enable it from "Advanced Javascript Settings" window.
Happy coding...
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
My popular framework’s version 2 release candidate released.
More about:
http://weblogs.asp.net/scottgu/archive/2010/01/10/asp-net-mvc-2.aspx
http://haacked.com/archive/2009/12/16/aspnetmvc-2-rc.aspx
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5

Just enable “Integrated Windows authentication” of your IIS web application
If this is not working try to re-register your .NET framework with aspnet_regiis.exe
Happy coding.
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
You can add the <location> element with the
“inheritInChildApplications” attribute to the root web.config. This
attribute will prevent child applications inherit some specified
configuration from the root web.config.
The attribute must be placed in the <configuration> section of the web.config. It looks like this:
<location path="." inheritInChildApplications="false">
<system.web>
<!--
……
Your settings
-->
</system.web >
</location>
Referance:
SectionInformation.InheritInChildApplications Property
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
You can use using statement to inculde different namespaces in you code behind file. But still you can't call methods from classes that live in other namespaces (Different from you page class namespace) from you content pages (.aspx).
To make this work you must use import namespace directive after you page directive.
1 <%@ Import="" Namespace="ICF.Common" %>
This can be a hard tast if you have a lot of pages. So you can define your namespaces in you web.config file and call your business class methods in your .aspx pages whenever you want.
1 <?xml version="1.0"?>
2 <configuration>
3 <system.web>
4 <pages>
5 <namespaces>
6 <add namespace="ICF" />
7 <add namespace="ICF.Common"/>
8 </namespaces>
9 </pages>
10 </system.web>
11 </configuration>
Happy coding...
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
"HttpContext.Current.Cache" has a metod to remove items one by one with their key names.
If you want to remove all items from the cache you can use this little code snippet to achive this task:
1 IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator();
2 while (enumerator.MoveNext())
3 {
4 HttpContext.Current.Cache.Remove(enumerator.Key.ToString());
5 }
Happy coding...
P.S.: This techique don't effect the output cached pages.
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
When you are using the SiteMapPath control page Urls with the querystrings, pages don't show the control. Because url can't be matched with url in your Web.Sitemap file.
To handle this situation, a little web.sitemap file trick is enough. Write the static part of your Url and define the dynamic querystring parameters at "reliantOn" attribute.
Sample Web.sitemap node definiton:
1 <siteMapNode url="~/a.aspx?p=add" title="ABC" reliantOn="Id" />
Happy codings...
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
In .NET world it's very common to write methods with same name but different parameters. This is called overloading. And if you use this technique wisely you can prevent some code repetation.
But in the web services world of .net its not allowed by default. If you try you get an exception says : "Bla, bla, bla. Use the MessageName property of the WebMethod custom attribute to specify unique message names for the methods."
Server Error in '/ICFWebServices' Application.
Both
ICFWebServices.Entities.Portal GetCategorizedRoomData(System.String)
and ICFWebServices.Entities.Portal GetCategorizedRoomData() use the
message name 'GetCategorizedRoomData'. Use the MessageName property of
the WebMethod custom attribute to specify unique message names for the
methods.
First you must differ your methods with WebMethod's properties.
1 [WebMethod(MessageName = "GetCategorizedRoomData",
2 Description = "Gets the room list for configured portal name")]
3 public Portal GetCategorizedRoomData()
4 {
5 string portal = "ICanFootball"; //Buraya web.configden portal okuma gelecek
6 return populateCategorizedRoomData(portal);
7 }
8
9 [WebMethod(MessageName = "GetCategorizedRoomDataByPortalName",
10 Description = "Gets the room list for given portal name")]
11 public Portal GetCategorizedRoomData(string Portal)
12 {
13 return populateCategorizedRoomData(Portal);
14 }
Second you have to change your web service class Wsi profile to none
1 [WebService(Namespace = "http://tempuri.org/")]
2 [WebServiceBinding(ConformsTo = WsiProfiles.None)]
3 public class RoomService : System.Web.Services.
WebService
4 {
If you forget step 2 you get an exception like
Server Error in '/ICFWebServices' Application.
Service
'ICFWebServices.RoomService' does not conform to WS-I Basic Profile
v1.1. Please examine each of the normative statement violations below.
To turn off conformance check set the ConformanceClaims property on
corresponding WebServiceBinding attribute to WsiClaims.None.
R2304:
Operation name overloading in a wsdl:portType is disallowed by the
Profile. A wsdl:portType in a DESCRIPTION MUST have operations with
distinct values for their name attributes. Note that this requirement
applies only to the wsdl:operations within a given wsdl:portType. A
wsdl:portType may have wsdl:operations with names that are the same as
those found in other wsdl:portTypes.
- Operation 'GetCategorizedRoomData' on portType 'RoomServiceSoap' from namespace 'http://tempuri.org/'.
To make service conformant please make sure that all web methods belonging to the same binding have unique names.
Happy coding.
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
We are developing a new ASP.NET web application in Visual studio 2008. Last week we've decided to use HttpHandlers instead of some web pages. And as we used to do in Visual Studio 2005 web sites created an App_code folder after that we created new classes under that folder.
Then we noticed that there is intellisense problem with these files. Also we noticed that there is a namespace problem with these classes.
When you add new class to app_code folder VS2008 names the class like this: RootNameSpace.App_Code.Class1. But object browser doesn't include any definition about App_Code namespace and sub classes.
figure 1: No namespace for ICFWeb.App_Code
Then I decided to check the properties of the classes. Right clicked a class under the App_code folder. And select its properties.
figure 2: No intellisense and color highlighting for editor.
When we looked at the properties. We saw build action for class is set to "Content". Problems are fixed after i changed that property to "Compile"
figure 3: Change build action from "Content" to "Compile"
After i searched the google for source of the problem. Problem is the app_code folder is for the web sites. There is no use of that folder for the web applications. Also app_code folder is not included in the "Add ASP.NET Folder" context menu of the solution explorer when you want to add App_code folder to your web application project.
Happy coding...
Bu yazıyı ilk değerlendiren siz olun
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5