
|
Today I came across a situation where I need to validate CheckboxList as required field and found below solution:
<asp:CheckBoxList ID="chlZones" runat="server" RepeatColumns="5" RepeatDirection="Horizontal" />
<asp:CustomValidator ID="cvalZones" runat="server" ClientValidationFunction="ValidateZones" ErrorMessage="!!!" Display="Dynamic" />
<script>
function ValidateZones(source, args) {
var chlZones = document.getElementById('');
var chkLista = chlZones.getElementsByTagName("input");
for (var i = 0; i < chkLista.length; i++) {
if (chkLista[i].checked) {
args.IsValid = true;
return;
}
}
args.IsValid = false;
}
</script>
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|

|
Trap RedioButtonList change event in Jqury OR RadioButtonList selected value in Jquery:
<asp:RadioButtonList ID="rblBannerType" ClientIDMode="Static" runat="server" RepeatDirection="Horizontal" >
<asp:ListItem Value="image" Selected="True">Image</asp:ListItem>
<asp:ListItem Text="html" >Html</asp:ListItem>
</asp:RadioButtonList>
//jquery script
<script>
$(function () {
var t = $("#rblBannerType input:checked").val();
SetBannerType(t);
//Banner Type
$("#rblBannerType").change(function () {
var type = $("#rblBannerType input:checked").val();
SetBannerType(type);
});
});
function SetBannerType(type) {
if (type == "image") {
$("#divImage").show();
$("#divHtml").hide();
}
else {
$("#divHtml").show();
$("#divImage").hide();
}
}
</script>
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|

|
- WPF support Resolution independent and vector-based rendering engine
- Most part is located under System.Windows Namespace
- Additional programming construct dependency property and routed events
- Support Attached property concept
- Ability to develop an application using both markup and code-behind
Markup is not tightly coupled with behavior specific code
- We can developed Standalone Application and Browser-Hosted Application
- Two way binding with any controls
Dependency Prperty
------------------------------------------------------
* Rsources
<DockPanel.Resources>
<SolidColorBrush x:Key="MyBrush" Color="Gold"/>
</DockPanel.Resources>
Once the resource is defined, you can reference the resource and use it to provide a property value:
<Button Background="{DynamicResource MyBrush}" Content="I am gold" />
* Data Binding
<Button Content="{Binding Books/@TeamName}"/>
* Styles
<Style x:Key="GreenButtonStyle">
<Setter Property="Control.Background" Value="Green"/>
</Style>
-------------
<Button Style="{StaticResource GreenButtonStyle}">I am green!</Button>
* Animations
* Metadata Overrides
public class SpinnerControl : ItemsControl
{
static SpinnerControl()
{
DefaultStyleKeyProperty.OverrideMetadata(
typeof(SpinnerControl),
new FrameworkPropertyMetadata(typeof(SpinnerControl))
);
}
}
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|

|
Write a WebMethod and set the Enable as True
Note: Default is false
[System.Web.Services.WebMethod(EnableSession=true)]
public double YourMethod()
{
//TODO: Method implementation
}
In order to store session state in the Asp.Net HttpSessionState object, the XML web service must inherit from WebService and a WebMethod attributes applied to the XML web service method, setting the EnableSession property to true.
An XML Web service client is uniquely identified by an HTTP cookie returned by an XML Web service. In order for an XML Web service to maintain session state for a client, the client must persist the cookie. Clients can receive the HTTP cookie by creating a new instance of CookieContainer and assigning that to the CookieContainer property of the proxy class before calling the XML Web service method. If you need to maintain session state beyond when the proxy class instance goes out of scope, the client must persist the HTTP cookie between calls to the XML Web service. For instance, a Web Forms client can persist the HTTP cookie by saving the CookieContainer in its own session state. Because not all XML Web services use session state and thus clients are not always required to use the CookieContainer property of a client proxy, the documentation for the XML Web service should state whether session state is used.
|
|
|
|

|
IIS Search Engine Optimization Toolkit
Search engine optimization (SEO) is the process of providing the quality of traffic to a web site from any search engines through “natural” (“organic” or “algorithmic”) search results.
Search engine optimization is a process, it involves editing it’s content and HTML coding to both increase its relevance to specific keywords and to remove barriers to the indexing activities of search engines.
You r slightly mistakes can do impact on the search relevance your site’s content and hence miss out on the traffic that you should be receiving.
Mistakes can be:
- Multiple URLs on a site leading to the same content
- Broken links from a page
- Poorly chose titles
- Descriptions of the pages
- Keywords
- Large amounts of viewstate
- Invalid markup
- Using JavaScript menus
- Flash website without HTML
– Images for Headlines
Microsoft introduced new tool for the search engine optimization called IIS Search Engine Optimization Toolkit. It helps to improve their web site’s relevance in search results by recommending how to make the site content more search engine friendly.
This Toolkit includes following modules-
- Site Analysis module
- Robots Exclusion module
– Sitemaps and Site indexes module
It contents following silent features:
Site Analysis Features
o Fully featured crawl engine named ‘iisbot’
o Configurable number of concurrent requests to allow users to crawl their Web site without incurring additional processing. This can be configured from 1 to 16 concurrent requests.
o Support for Robots.txt, allowing you to customize the locations where the iisbot should analyze and which locations should be ignored.
o Support for Sitemap files allowing you to specify additional locations to be analyzed.
o Support for overriding ‘noindex’ and ‘nofollow’ metatags to allow you to analyze pages to help improve customer experience even when search engines will not process them.
o Configurable limits for analysis, maximum number of URLs to download, and maximum number of kilobytes to download per URL.
o Configurable options for including content from only your directories or the entire site and sub domains.
o View detailed summary of Web site analysis results through a rich dashboard
o Feature rich Query Builder interface exposing large amounts of data
o Quick access to common tasks
o Display of detailed information for each URL
o View detailed route analysis showing unique routes to better understand the way search engines reach your content
Robots Exclusion Features
o Display of robots content in a friendly user interface
o Support for filtering, grouping, and sorting
o Ability to add ‘disallow’ and ‘allow’ paths using a physical view of your Web site
o Ability to add ‘disallow’ and ‘allow’ paths using a logical view of your Web site from the result of site analysis processing
o Ability to add sitemap locations
Sitemap and Sitemap Index Features
o Display of sitemaps and sitemap index files in a simple user interface
o Support for grouping and sorting
o Ability to add/edit/remove sitemap and sitemap index files
o Ability to add new URL’s to sitemap and sitemap index files using a physical view of your Web site
o Ability to add new URL’s to sitemap and sitemap index files using a logical view of your Web site from the result of site analysis processing
o Ability to register a sitemap or sitemap index into the robots exclusion file
Find great artiles by Scott
http://weblogs.asp.net/scottgu/archive/2009/06/03/iis-search-engine-optimization-
toolkit.aspx
Reference:
http://www.iis.net/extensions/SEOToolkit
|
|
|
|

|
I have came across the many forum and found there so many developers asked how to send email but the don't have SMTP server.
I would like to suggest here those guy who want to implement their email functionality in his project then for testing purpose they can use Gmail account.
MailMessage MyMailMessage=new MailMessage();
MyMailMessage.From = new MailAddress("g.parwez@gmail.com");
MyMailMessage.To.Add("g.parwez@gmail.com");
MyMailMessage.Subject = "Parwej Testing !!!";
MyMailMessage.Body = "This is the test text for Parwej Ahamad";
SmtpClient SMTPServer=new SmtpClient("smtp.gmail.com");
SMTPServer.Port = 587;
SMTPServer.Credentials =new System.Net.NetworkCredential("yourgmaid", "yourgmailpassword");
SMTPServer.EnableSsl = true;
SMTPServer.Send(MyMailMessage);
Note: Please do not use Gmail SMTP server without read Terms & Condition given by Gmail.
Parwej Ahamad
|
|
|
|