Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views
Hi,

Some of the special charaters are not showing properly in hte rad editor
it's displaying unrecognized formate. Please find some unicode below that not showing in the rad editor

𕫠
𕫡
𕫢
𕫣
𕫤
𕫥
𕫦

Pls. suggest me how to go about it

Thank you
Rumen
Telerik team
 answered on 20 Dec 2011
1 answer
61 views
I see that TeamPulse offers Microsoft Lync integration, showing user prescence information about a person, which lets the user click on the little green or red circle next to their name to do "Lync communication" type of actions via the little Lync popup window.

Can I build in Microsoft Lync integration into my custom apps that I build with the Telerik developer tools? Such as I have a RadGrid that lists rows of employees. I'd like the little green/red icons to appear next to their names, just like they do in Microsoft Outlook so a user of my RadGrid could click the green circle in my RadGrid to open Lync-stuff.

Is that available? Or just not yet?  Thanks.

Dave



Daniel
Telerik team
 answered on 20 Dec 2011
7 answers
216 views
Hi Telerik,

I am experiencing this issue on Google Chrome 15.0.874.106 m using Telerik.Web.UI.dll v 2011.2.915.35

I have a RadWindow which points to a separate .aspx page. While this window is loading I take the liberty of setting the state of some controls. I am experiencing something very quirky when I enable my input control, though.

I have attached a 'before' and 'after' picture to this thread, but I've got some explaining to do, too. I put this through a couple of hours of testing and discovered some pretty weird discrepancies in functionality, which I would like to draw attention to. 

Alright, so, here's the code-behind for the page the RadWindow points to:

<%@ Page Language="C#" EnableViewState="False" AutoEventWireup="True" CodeBehind="CustomLocalSettings.aspx.cs" Inherits="CableSolve.Web.Dashboard.Dialog.Windows.CustomLocalSettings" %>
<%@ Import Namespace="CableSolve.Web.Controllers.Managers" %>
 
<!DOCTYPE html>
<html lang="en">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
             
            <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" Runat="Server" />
            <telerik:RadFormDecorator ID="RadFormDecorator1" Runat="Server" DecoratedControls="All" />
 
            <telerik:RadScriptBlock ID="RadScriptBlock1" Runat="Server" >
                <link rel="stylesheet" type="text/css" href="../../../Content/Dashboard/CustomLocalSettings.css?v=<%= VersionManager.GetApplicationVersion() %>" />
            </telerik:RadScriptBlock>
 
            <telerik:RadScriptManager ID="RadScriptManager1" Runat="Server" EnablePageMethods="True">
                <CompositeScript>
                    <Scripts>
                        <asp:ScriptReference Path="~/Scripts/Dashboard/CustomLocalSettings.js" />
                        <asp:ScriptReference Path="~/Scripts/Dashboard/SharedSettingsFunctionality.js" />
                        <asp:ScriptReference Path="~/Scripts/jquery-1.6.4.js" />
                    </Scripts>
                </CompositeScript>
            </telerik:RadScriptManager>
 
            <telerik:RadCodeBlock ID="RadCodeBlock1" Runat="server">
                <script type="text/javascript">
                    var autoRefreshNumericTextBoxID = "<%= AutoRefreshNumericTextBox.ClientID %>";
                    var chartComboBoxID = "<%= ChartComboBox.ClientID %>";
                    var autoRefreshCheckBoxID = "<%= AutoRefreshCheckBox.ClientID %>";
                </script>
            </telerik:RadCodeBlock>
 
            <div id="Content">
                <fieldset id="RefreshProperties">
                    <legend>Refresh Settings</legend>
                    <div id="RefreshArea">
                        <div id="RefreshLeftSide">
                            Auto-Refresh Enabled:
                            <asp:CheckBox ID="AutoRefreshCheckBox" Runat="Server" />
                        </div>
                        <div id="RefreshRightSide">
                            <telerik:RadNumericTextBox ID="AutoRefreshNumericTextBox" Runat="Server" Label="Auto-Refresh Interval (Minutes):" MaxValue="60" MinValue="1" ShowSpinButtons="True" Value="1" Width="225px" DataType="System.Int32">
                                <NumberFormat DecimalDigits="0" AllowRounding="False" />
                            </telerik:RadNumericTextBox>
                        </div>
                    </div>
                </fieldset>
 
                <fieldset id="ChartProperties">
                    <legend>Chart Properties</legend>
                    <div id="ChartArea">
                        <telerik:RadComboBox ID="ChartComboBox" Runat="Server">
                            <Items>
                                <telerik:RadComboBoxItem Runat="Server" Text="Bar Chart" Value="BarChart" />
                                <telerik:RadComboBoxItem Runat="Server" Text="Stacked Bar Chart" Value="StackedBarChart" />
                            </Items>
                        </telerik:RadComboBox>
                    </div>
                </fieldset>
 
                <div class="BottomButton">
                    <asp:UpdatePanel>
                        <ContentTemplate>
                            <telerik:RadButton ID="ApplySettings" Runat="Server" Text="Apply" OnClientClicked="CloseAndSave" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
        </form>
    </body>
</html>

Note that for my example the most-relevant portion of the code is located within the "RefreshProperties" div.
In addition, note that I am able to reproduce this issue with the CSS file commented out. I'll provide it at the end of this document just for the sake of it, but you should not need it.

//SharedSettingsFunctionality.js
 
//Contains functionality that all the dialog windows share in common. I found that I was maintaing a lot of code in multiple places unnecessarily.
function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
}
 
function OnGetDockAttributesFailure(errors) {
    alert(errors);
}
 
function SetAutoRefreshState() {
    var autoRefreshNumericTextBox = $find(window.autoRefreshNumericTextBoxID);
    var wrapperElement = $get(autoRefreshNumericTextBox._wrapperElementID);
    var label = $(wrapperElement.getElementsByTagName("label")[0]);
    if ($('#' + window.autoRefreshCheckBoxID).is(':checked')) {
        autoRefreshNumericTextBox.enable();
        label.addClass("LabelEnabled");
        label.removeClass("LabelDisabled");
    }
    else {
        autoRefreshNumericTextBox.disable();
        label.addClass("LabelDisabled");
        label.removeClass("LabelEnabled");
    }
}

//CustomLocalSettings.js
 
function pageLoad() {
    var oWindow = GetRadWindow();
    var dockID = oWindow.argument;
 
    if (dockID) {
        InitializeForm(dockID);
    }
    oWindow.argument = null;
}
 
function InitializeForm(dockID) {
    SetAutoRefreshState();
    $('#' + window.autoRefreshCheckBoxID).click(SetAutoRefreshState);
 
    window.PageMethods.GetDockAttributes(dockID, OnGetDockAttributesSuccess, OnGetDockAttributesFailure);
}
 
//Pass the dialog data back to Dashboard.
function CloseAndSave() {
    var oWindow = GetRadWindow();
    var customAttributes = {};
    customAttributes["RefreshEnabled"] = $('#' + window.autoRefreshCheckBoxID).is(':checked');
    customAttributes["RefreshInterval"] = $find(window.autoRefreshNumericTextBoxID).get_value();
    customAttributes["ChartType"] = $find(window.chartComboBoxID).get_value();
    oWindow.argument = customAttributes;
    oWindow.close();
    oWindow.argument = null; //Important because pageLoad gets called once more after oWindow closes.
}
 
function OnGetDockAttributesSuccess(result) {
    var dockData = $.parseJSON(result);
    //Change the initial loading state based on the dock's known settings.
    if (dockData["RefreshEnabled"]) {
        $('#' + window.autoRefreshCheckBoxID).attr('checked', true);
 
        var autoRefreshNumericTextBox = $find(window.autoRefreshNumericTextBoxID);
 
        autoRefreshNumericTextBox.set_value(dockData["RefreshInterval"]);
        autoRefreshNumericTextBox.enable();
 
        var wrapperElement = $get(autoRefreshNumericTextBox._wrapperElementID);
        var label = $(wrapperElement.getElementsByTagName("label")[0]);
        label.addClass("LabelEnabled");
        label.removeClass("LabelDisabled");
    }
 
    $find(window.chartComboBoxID).findItemByValue(dockData["ChartType"]).select();
 
    $('#Content').show();
    GetRadWindow().autoSize();
}

Okay, once again, most of this is not necessary -- but if it came down to it I wanted Telerik to be able to build easily.

Anyway, the following code executes:

  •  CustomLocalSettings - pageLoad (calling InitializeForm);
  •  CustomLocalSettings - InitializeForm (calling SetAutoRefreshState );
  •  SharedSettingsFunctionality - SetAutoRefreshState: This method sets my input controls to disabled initially on default behavior.

At this point the code relevant to this discussion has fired, the window loads, and looks fine. AutoRefreshNumericTextBox is disabled, as well as it's associated CheckBox. The user then clicks the CheckBox to enable the AutoRefreshNumericTextBox. When it becomes enabled, the input holds its location but the label and arrow-adjuster break from their div and drop.

This in itself wasn't that weird, bugs happen, but there's some other weird things to mention:

  1. I have this exact same code on another dialog window which uses ContentTemplate instead of directing to a separate page. It does not experience this issue. Only having the FormDecorator on a page which is loading seems to cause the issue.
  2. If I tell FormDecorator to use DecorationZoneID = "Content" then I see a change in the error. Instead of arising when the input control becomes enabled (the control enables fine..), I see the div break out when I press the 'Up' arrow on the RadNumericTextBox.
  3. Similarly, if I tell the control to skip decorating TextBox's, the control renders fine until I press the 'Up' arrow.

If I disable the FormDecorator I do not see any issues.

I performed a diff of the HTML mark-up being rendered before/after the control breaks from the div. The only change I saw, other than the CssClass changing from LabelEnabled to LabelDisabled, was that the RadNumericTextBox gained maxlength="524288"

The control does not gain this property when it is loaded inside of the ContentTemplate RadWindow.

Other information:

//CustomLocalSettings CSS
 
body
{
    font-size: 12px;
    font-family: "segoe ui", arial, sans-serif;
    overflow: hidden;
    /*Leave this for auto-sizing behavior under IE*/
    width: 403px;
}
 
.LabelEnabled,
.riTextBox
{
    color: Black !important;
}
 
.LabelDisabled
{
    color: Gray !important;
}
 
.BottomButton
{
    padding-top: 7px;
    margin-left: 170px;
    padding-bottom: 7px;
}
 
#RefreshArea
{
    padding: 2px;
}
 
/*Leave this for IE8: Extends the fieldset to make it look proper.*/
#ChartArea
{
    width: 378px;
}
 
#RefreshLeftSide
{
    float: left;
    margin-top: 3px;
}
 
#RefreshRightSide
{
    float: left;
    margin-left: 5px;
}
 
.rfdRoundedWrapper_fieldset
{
    display: block\9 !important;
}
 
#RefreshArea,
#ChartArea
{
    overflow: auto\9;
    margin: 4px 5px 8px 5px\9;
}
 
._Telerik_IE9 #RefreshArea,
._Telerik_IE9 #ChartArea
{
    margin: 0px;
}
 
#Content
{
    display: none;
}

PasteBins for HTML Diffs:

RadWindow which points to .ASPX 


RadWindow using content template:


See attached for 3 screenshots.

Thank you for your time. I hope I have provided enough information for you guys to track this down on your end. Hopefully it's not a super simple mistake on my end... 
Bozhidar
Telerik team
 answered on 20 Dec 2011
6 answers
108 views
Hi,

I'd like to use the dock control as a panel control that works with the normal flow of a web page.  No docking etc functionality.  Is that possible with it as it stands?

If not possible, is there a way to use a div couples with the styles of the Dock to get it working.  

This should be created as a panel control as I'm sure that many developers would find it useful.

Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 20 Dec 2011
1 answer
110 views
Hi,

I've a radrotator (which has property

EnableRandomOrder="true"  and

 

PauseOnMouseOver

 

="false"

 

 as below. In the attached image below, Next Item to be shown is Disease Analytics when i click on the ControlButtons in right side. How can i access the index/ item itself on click of the control button in javacript. I need the next item/previous item to be shown when i click on the controlbuttons in javascript only as I've to update the description of the selected item using ajaxmanager and also on random click on the radrotator item(which is an image) corresponding description has to be shown.
 Below is the javascript for

<ControlButtons OnClientButtonClick="OnClientButtonClick" />



function OnClientButtonClick(sender, args) {
 
    var objArgs;
    debugger;
    if (typeof sender._nextItemIndex === "undefined")
        objArgs = 0;
    else {
 
 
        if (sender._nextItemIndex == null)
            objArgs = 0;
        else
            objArgs = sender._nextItemIndex;
    }
    //sender.get_currentItem().get_index();
    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(objArgs);
 
}


<telerik:RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
       runat="server" DefaultLoadingPanelID="LoadingPanel1">
       <AjaxSettings>
 
           <telerik:AjaxSetting AjaxControlID="chkRotationType">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="radRotProducts" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
               <UpdatedControls>
                   
                   <telerik:AjaxUpdatedControl ControlID="detailsPanel" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>

<telerik:RadAjaxPanel ID="AjaxPanel1" CssClass="rotNoButtonsBack" runat="server" LoadingPanelID="LoadingPanel1">
                      <div class="mainDiv">
                          <div class="rotatorBackground">
                              <%-- ItemWidth and ItemHeight include 2x5(pixels) margin and 1x2(pixels) border --%>
                              <telerik:RadRotator ID="radRotProducts" RotatorType="CarouselButtons" runat="server"
                              EnableRandomOrder="true" PauseOnMouseOver="false"
                              OnClientItemClicked="OnClientItemClicked"    Width="800px" Height="400px" CssClass="rotatorCarouselStyle" ItemHeight="200"
                                  FrameDuration="2000" ItemWidth="300" ScrollDuration="500">
                                  <ItemTemplate>
                                      <asp:Image runat="server" ID="imgProduct" ImageUrl='<%#DataBinder.Eval(Container.DataItem,"Image")%>'
                                          CssClass="RotatorItem" />
                                  </ItemTemplate>
                               
                                  <ControlButtons  OnClientButtonClick="OnClientButtonClick" />
                              </telerik:RadRotator>
 
                          </div>
                      </div>
                  </telerik:RadAjaxPanel>
Slav
Telerik team
 answered on 20 Dec 2011
0 answers
151 views
Hi,

i have RadTimePicker that displays times as attached snapshot (radtimepicker.png). so i need to disable hours based on specific criteria.

for example i need to disable and grey-out all the times after 6AM and before 12PM, so i used set_minDate and set_maxDate in java script but not grayed-out just give me warning.

is this possible with radtimepicker to gray-out and disable unallowed times?

following is example of code:



ASPX:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
     function setAllowedDate(sender, args)
     {
        setMinDate();
        setMaxDate();
     }


     function setMinDate() {
         var timePicker = $find("<%= RadTimePicker1.ClientID %>");
             var date1 = new Date();
             date1.setHours(<%=MinTimeAllowed %>, 0, 0, 0);
             timePicker.set_minDate(date1);
             
     }

     function setMaxDate() {
         var date1 = new Date();
         date1.setHours(<%=MaxTimeAllowed %>, 0, 0, 0);
         var timePicker = $find("<%= RadTimePicker1.ClientID %>");
        
         timePicker.set_maxDate(date1);
     }

    </script>
    <br />
    <br />
    <br />
    Select time:
    <telerik:RadTimePicker ID="RadTimePicker1" runat="server" ZIndex="30001">
    <ClientEvents OnPopupOpening="setAllowedDate" />
    </telerik:RadTimePicker>
    
</asp:Content>




code behind:

public partial class Default2 : System.Web.UI.Page
{
    private int m_MinTimeAllowed=0;
    protected int m_MaxTimeAllowed=24;
    protected void Page_Load(object sender, EventArgs e)
    {
        m_MinTimeAllowed=5;
        m_MaxTimeAllowed = 20;


    }

    protected int MinTimeAllowed
    {
        get
        {
            return m_MinTimeAllowed;
        }
    }


    protected int MaxTimeAllowed
    {
        get
        {
            return m_MaxTimeAllowed;
        }
    }
}




please this task very urgent.

Thanks

Ahamd
Top achievements
Rank 1
 asked on 20 Dec 2011
3 answers
73 views
Hi,
I'm trying to follow the instructions on this page (and the previous help pages) http://www.telerik.com/help/aspnet-ajax/grid-getting-started.html to create a simple web application containing a rad grid. 
The problem is this:
When clicking the grid smart tag for "Choose Data Source", and selecting "New Data Source", the configuration wizard opens without any options. I can't select a SQL database, because that option doesn't appear. The only option which appears is "Site Map".
This is true for both my test application and the Telerik Live Demos - no options in the configuration wizard.
Has anyone encountered this situation?

.Net 3.5, Telerik RadControls for ASP.NET Ajax Q1 2011 SP2
Windows Xp Pro
Visual Studio 2008, C#
Mira
Telerik team
 answered on 20 Dec 2011
1 answer
106 views
Hi
Here is what I am trying to do and was unsuccessful.

The user clicks submit button. If there is already an order with the same ticket number I need to show a confirm window asking user if he/she is sure to submit with the same ticket number. If the user chooses to click on "No" button I do not do anything and ask user to correct the ticket number. If the user clicks on OK I need to redirect user to a different page.

Any help appreciated.

I tried using the RadConfrim method on the window manager but there is no way to get back to server sider after the OK button click. I tried to create a custom radwindow with content template but wasnt sure how to continue further.

THanks
Princy
Top achievements
Rank 2
 answered on 20 Dec 2011
3 answers
234 views
I have several combo boxes on a single web page.  I will include both the display (.aspx) code and the code behind code below shortly.

After page load, selecting an entry from the first combo box (Cycle) triggers the loading of both the second (Election) and third combo boxes (Political Race).  All of this cascading works fine, until (for example) when the page does not validate due to the custom validation on the very last textbox on the page (Web Site URL).

If an error is found on this custom validation, the page is refreshed and both the second and third combo boxes (Election and Political Race) have lost their selections.  Once this happens, then errors are displayed for the second and third combo boxes and for the "Web Site URL" as well and this creates a kind of "deadly embrace" that the user cannot remove themselves from.

My basic question is "Why are the Election and Political Race combo boxes losing their selection during this validation process and what can I do to prevent this loss?

Here is the .aspx code.  The code behind follows.

<%@ Page Title="Campaign Finance - Create New Petition" Language="C#" MasterPageFile="~/Masters/EPSDev2.master" AutoEventWireup="true" CodeFile="NewPetition.aspx.cs" Inherits="NewPetition" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageHeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" Runat="Server">
    <div style="width: 100%;">
        <div style="float: left; background-color: White; padding: 10px;">
            <table cellpadding="20" cellspacing="0" border="0" >
                <tr>
                    <td width="5%">
                          
                    </td>
                    <td align="center" width="90%" nowrap="nowrap">
                        <table cellpadding="0" cellspacing="15" id="TABLE1" >
                            <tr>
                                <td colspan="2" align="center" >
                                    <h2>
                                        <asp:Label ID="VoterAuthenticationLabel" runat="server" Text="Create New Petition"></asp:Label>
                                    </h2>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center" style="font-weight: normal; height: 12px;">
                                    <asp:Label ID="InfoLabel" runat="server" Text="(Please enter the information requested below and then click on the SUBMIT button)"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center" style="font-weight: normal; height: 12px;">
                                      
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="left" style="font-weight: normal; height: 12px;">
                                    <asp:Label ID="Label6" runat="server" Font-Bold="true" Text="CANDIDATE INFORMATION:"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="CycleLabel" runat="server" Text="Cycle:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadComboBox ID="ElectionCycleList" runat="server" TabIndex="1" EnableEmbeddedSkins="true" Skin="Default" OnClientSelectedIndexChanging="LoadPoliticalRaceList" >
                                    </telerik:RadComboBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="ElectionCycleListReqd" ControlToValidate="ElectionCycleList"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must select an Election Cycle from the list"
                                        ForeColor="Red">
                                    </asp:RequiredFieldValidator>
                                    <asp:CustomValidator
                                        ID="CustomValidator5"
                                        runat="server"
                                        ControlToValidate="ElectionCycleList"
                                        ClientValidationFunction="validateCombo5"
                                        ErrorMessage="<br>You must select an Election Cycle from the list"
                                        ValidationGroup="DEForm" Display="Dynamic" ForeColor="Red"
                                        >
                                    </asp:CustomValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label14" runat="server" Text="Election:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadComboBox ID="ElectionList" runat="server" TabIndex="1" OnClientItemsRequested="SearchItemsLoaded" OnItemsRequested="ElectionList_ItemsRequested" EnableEmbeddedSkins="true" Skin="Default"
                                     EnableViewState="true" ViewStateMode="Enabled"
                                     >
                                    </telerik:RadComboBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="ElectionListReqd" ControlToValidate="ElectionList"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must select an Election from the list."
                                        ForeColor="Red">
                                    </asp:RequiredFieldValidator>
                                    <asp:CustomValidator
                                        ID="CustomValidator4"
                                        runat="server"
                                        ControlToValidate="ElectionList"
                                        ClientValidationFunction="validateCombo4"
                                        ErrorMessage="<br>You must select an Election from the list"
                                        ValidationGroup="DEForm" Display="Dynamic" ForeColor="Red"
                                        >
                                    </asp:CustomValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label1" runat="server" Text="Political Race:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadComboBox ID="PoliticalRaceList" Width="250px" runat="server" TabIndex="2" OnClientItemsRequested="SearchItemsLoaded" OnItemsRequested="PoliticalRaceList_ItemsRequested" EnableEmbeddedSkins="true" Skin="Default" >
                                    </telerik:RadComboBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="PoliticalRaceListReqd" ControlToValidate="PoliticalRaceList"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must select a Political Race from the list"
                                        ForeColor="Red">
                                    </asp:RequiredFieldValidator>
                                    <asp:CustomValidator
                                        ID="CustomValidator3"
                                        runat="server"
                                        ControlToValidate="PoliticalRaceList"
                                        ClientValidationFunction="validateCombo3"
                                        ErrorMessage="<br>You must select a Political Race from the list"
                                        ValidationGroup="DEForm" Display="Dynamic" ForeColor="Red"
                                        >
                                    </asp:CustomValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label12" runat="server" Text="Political Party:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadComboBox ID="PoliticalPartyList" runat="server" TabIndex="3" EnableEmbeddedSkins="true" Skin="Default">
                                    </telerik:RadComboBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="PoliticalPartyList"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must select a Political Party from the list"
                                        ForeColor="Red">
                                    </asp:RequiredFieldValidator>
                                    <asp:CustomValidator
                                        ID="CustomValidator2"
                                        runat="server"
                                        ControlToValidate="PoliticalPartyList"
                                        ClientValidationFunction="validateCombo2"
                                        ErrorMessage="<br>You must select a Political Party from the list"
                                        ValidationGroup="DEForm" Display="Dynamic" ForeColor="Red"
                                        >
                                    </asp:CustomValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label2" runat="server" Text="Name:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadTextBox ID="CandidateName" runat="server" MaxLength="50" Width="200px" TabIndex="4" EnableEmbeddedSkins="true" Skin="Default" ></telerik:RadTextBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="CandidateNameReqd" ControlToValidate="CandidateName"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must enter the Candidate's Name"
                                        ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label3" runat="server" Text="Address:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadTextBox ID="CandidateAddress1" runat="server" MaxLength="50" Width="200px" TabIndex="5" EnableEmbeddedSkins="true" Skin="Default"></telerik:RadTextBox> <img
                                        alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="CandidateAddress1Reqd" ControlToValidate="CandidateAddress1"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must enter the Candidate's Address"
                                        ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label13" runat="server" Text="Address 2:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadTextBox ID="CandidateAddress2" runat="server" MaxLength="50" Width="200px" TabIndex="5" EnableEmbeddedSkins="true" Skin="Default" ></telerik:RadTextBox>
                                    <br />
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label4" runat="server" Text="City, State, Zip Code:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadTextBox ID="CandidateCity" runat="server" MaxLength="50" Width="200px" TabIndex="6" EnableEmbeddedSkins="true" Skin="Default"></telerik:RadTextBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                       
                                    <telerik:RadTextBox ID="CandidateState" runat="server" MaxLength="2" Width="30px" TabIndex="7" Text="AZ" EnableEmbeddedSkins="true" Skin="Default"></telerik:RadTextBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                       
                                    <telerik:RadTextBox ID="CandidateZipCode" runat="server" TabIndex="8" MaxLength="10" Width="75px" EnableEmbeddedSkins="true" Skin="Default"></telerik:RadTextBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="CandidateCityReqd" ControlToValidate="CandidateCity"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must enter the Candidate's City"
                                        ForeColor="Red"></asp:RequiredFieldValidator>
                                    <asp:RequiredFieldValidator ID="CandidateStateReqd" ControlToValidate="CandidateState"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must enter the Candidate's State"
                                        ForeColor="Red"></asp:RequiredFieldValidator>
                                    <asp:RequiredFieldValidator ID="CandidateZipCodeReqd" ControlToValidate="CandidateZipCode"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must enter the Candidate's Zip Code"
                                        ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label5" runat="server" Text="County:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadComboBox ID="CandidateCountyList" runat="server" TabIndex="9" EnableEmbeddedSkins="true" Skin="Default">
                                    </telerik:RadComboBox>
                                     <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="CandidateCountyListReqd" ControlToValidate="CandidateCountyList"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must select the Candidate's County from the list"
                                        ForeColor="Red">
                                    </asp:RequiredFieldValidator>
                                    <asp:CustomValidator
                                        ID="CustomValidator1"
                                        runat="server"
                                        ControlToValidate="CandidateCountyList"
                                        ClientValidationFunction="validateCombo1"
                                        ErrorMessage="<br>You must select the Candidate's County"
                                        ValidationGroup="DEForm" Display="Dynamic" ForeColor="Red"
                                        >
                                    </asp:CustomValidator>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center" style="font-weight: normal; height: 12px;">
                                      
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="left" style="font-weight: normal; height: 12px;">
                                    <asp:Label ID="Label7" runat="server" Font-Bold="true" Text="CONTACT INFORMATION:"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label8" runat="server" Text="Name:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadTextBox ID="ContactName" runat="server" MaxLength="50" Width="200px" TabIndex="10" EnableEmbeddedSkins="true" Skin="Default"></telerik:RadTextBox> <img
                                        alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                    <asp:RequiredFieldValidator ID="ContactNameReqd" ControlToValidate="ContactName"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>You must enter the Contact's Name"
                                        ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label9" runat="server" Text="Telephone:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadTextBox ID="ContactPhone" runat="server" MaxLength="25" Width="100px" TabIndex="11" EnableEmbeddedSkins="true" Skin="Default" ></telerik:RadTextBox><br />
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label10" runat="server" Text="Email Address:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadTextBox ID="ContactEmailAddress" runat="server" MaxLength="256" Width="300px" TabIndex="12" EnableEmbeddedSkins="true" Skin="Default" ></telerik:RadTextBox><br />
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label ID="Label11" runat="server" Text="Web Site URL:"></asp:Label>
                                </td>
                                <td align="left">
                                    <telerik:RadTextBox ID="ContactWebSiteURL" runat="server" MaxLength="50" Width="200px" TabIndex="13" EnableEmbeddedSkins="true" Skin="Default" ></telerik:RadTextBox>
                                    <asp:CustomValidator ID="ContactWebSiteURLCustom" ControlToValidate="ContactWebSiteURL"
                                        ValidationGroup="DEForm" Display="Dynamic" runat="server" ErrorMessage="<br>If provided, the web site URL must be present on the Internet."
                                        ForeColor="Red" OnServerValidate="ValidateURL" ></asp:CustomValidator>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center" style="font-weight: normal; height: 12px;">
                                    <asp:Button ID="CreateButton" runat="server" Text="Create Petition" TabIndex="15" ValidationGroup="DEForm" onclick="CreateButton_Click" />
                                          
                                    <asp:Button ID="CancelButton" runat="server" Text="Cancel Petition" TabIndex="16" onclick="CancelButton_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center" style="font-weight: normal; height: 12px;">
                                    <img alt="Required field" src="<%=ResolveUrl("images/required2.gif")%>" />
                                     
                                    <asp:Label ID="IndicatesRequiredLabel" runat="server" Text="Indicates a required field"></asp:Label>
                                    <br />
                                    <asp:Label ID="StatusLabel" ForeColor="Red" runat="server" />
                                    <asp:ValidationSummary ID="ValidationSummary1" ValidationGroup="DEForm" DisplayMode="List"
                                        ForeColor="Red" ShowSummary="False" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td width="5%">
                          
                    </td>
                </tr>
            </table>
        </div>
        <div class="clear">
        </div>
    </div>
    <script type="text/javascript">
        function LoadPoliticalRaceList(combo, eventArqs) {
            var searchcycleCombo = $find("<%=ElectionCycleList.ClientID%>");
            var searchraceCombo = $find("<%=PoliticalRaceList.ClientID%>");
            var searchelectionCombo = $find("<%=ElectionList.ClientID%>");
 
            var item = eventArqs.get_item();
            searchraceCombo.set_text("Loading...");
            // if a cycle is selected
            if (item.get_index() > 0) {
                // this will fire the ItemsRequested event of the
                // property type combobox passing the transaction type as a parameter
                searchraceCombo.requestItems(item.get_value(), false);
            }
            else {
                // the -Select a cycle- item was chosen
                searchraceCombo.set_text(" ");
                searchraceCombo.clearItems();
            }
 
            var item = eventArqs.get_item();
            searchelectionCombo.set_text("Loading...");
            // if a cycle is selected
            if (item.get_index() > 0) {
                // this will fire the ItemsRequested event of the
                // property type combobox passing the transaction type as a parameter
                searchelectionCombo.requestItems(item.get_value(), false);
            }
            else {
                // the -Select a cycle- item was chosen
                searchelectionCombo.set_text(" ");
                searchelectionCombo.clearItems();
            }
        }
 
        function SearchItemsLoaded(combo, eventArqs) {
            if (combo.get_items().get_count() > 0) {
                // pre-select the first item
                combo.set_text(combo.get_items().getItem(0).get_text());
                combo.get_items().getItem(0).highlight();
            }
        }
 
        function validateCombo1(source, args) {
            args.IsValid = false;
            var combo = $find("<%= CandidateCountyList.ClientID %>");
            var text = combo.get_text();
            if (text.length < 1) {
                args.IsValid = false;
            }
            else {
                var node = combo.findItemByText(text);
                if (node) {
                    var value = node.get_value();
                    if (value.length > 0) {
                        args.IsValid = true;
                    }
                }
                else {
                    args.IsValid = false;
                }
            }
        }
         
        function validateCombo2(source, args) {
            args.IsValid = false;
            var combo = $find("<%= PoliticalPartyList.ClientID %>");
            var text = combo.get_text();
            if (text.length < 1) {
                args.IsValid = false;
            }
            else {
                var node = combo.findItemByText(text);
                if (node) {
                    var value = node.get_value();
                    if (value.length > 0) {
                        args.IsValid = true;
                    }
                }
                else {
                    args.IsValid = false;
                }
            }
        }
 
        function validateCombo3(source, args) {
            args.IsValid = false;
            var combo = $find("<%= PoliticalRaceList.ClientID %>");
            var text = combo.get_text();
            if (text.length < 1) {
                args.IsValid = false;
            }
            else {
                var node = combo.findItemByText(text);
                if (node) {
                    var value = node.get_value();
                    if (value.length > 0) {
                        args.IsValid = true;
                    }
                }
                else {
                    args.IsValid = false;
                }
            }
        }
 
        function validateCombo4(source, args) {
            args.IsValid = false;
            var combo = $find("<%= ElectionList.ClientID %>");
            var text = combo.get_text();
            if (text.length < 1) {
                args.IsValid = false;
            }
            else {
                var node = combo.findItemByText(text);
                if (node) {
                    var value = node.get_value();
                    if (value.length > 0) {
                        args.IsValid = true;
                    }
                }
                else {
                    args.IsValid = false;
                }
            }
        }
 
        function validateCombo5(source, args) {
            args.IsValid = false;
            var combo = $find("<%= ElectionCycleList.ClientID %>");
            var text = combo.get_text();
            if (text.length < 1) {
                args.IsValid = false;
            }
            else {
                var node = combo.findItemByText(text);
                if (node) {
                    var value = node.get_value();
                    if (value.length > 0) {
                        args.IsValid = true;
                    }
                }
                else {
                    args.IsValid = false;
                }
            }
        }
 
 
    </script>
 
</asp:Content>

Now the code behind...

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using System.Text;
using System.Net;
using System.IO;
 
public partial class NewPetition : System.Web.UI.Page
{
 
    protected void Page_Load(object sender, EventArgs e)
    {
        //  The purpose of this page is to initiate the creation of a new petition.
        //  We need to check for the presence of the query string member '19' and if its value is 'edt'.
        //  If yes to both of these questions, then the user has already entered the data for a new petition but
        //  clicked the edit button on the next confirmation page.
        //  If the answer to either of these is no, then we will give the user an empty page to enter data into
        //  except for the three (3) combo boxes --the Election Cycle, Political Party and the County combo boxes.
        //  The Political Race combo box will be dynamically loaded after the user selects an Election Cycle.
        if (!Page.IsPostBack)
        {
            //  If this is the new petition data coming back for edit from the confirmation page,
            //  then load the screen controls up with the data
            if (Request.QueryString["19"] == "edt")
            {
                this.CandidateName.Text = Request.QueryString["4"];
                this.CandidateAddress1.Text = Request.QueryString["5"];
                this.CandidateAddress2.Text = Request.QueryString["6"];
                this.CandidateCity.Text = Request.QueryString["7"];
                this.CandidateState.Text = Request.QueryString["8"];
                this.CandidateZipCode.Text = Request.QueryString["9"];
                this.ContactName.Text = Request.QueryString["11"];
                this.ContactPhone.Text = Request.QueryString["12"];
                this.ContactEmailAddress.Text = Request.QueryString["13"];
                this.ContactWebSiteURL.Text = Request.QueryString["14"];
                LoadElectionCycleList2(this.ElectionCycleList, Request.QueryString["1"]);
                LoadPoliticalRaceList2(this.PoliticalRaceList, Request.QueryString["2"]);
                LoadPoliticalPartyList2(this.PoliticalPartyList, Request.QueryString["3"]);
                LoadCountyList2(this.CandidateCountyList, Request.QueryString["10"]);
                LoadElectionList2(this.ElectionList, Request.QueryString["20"]);
            }
            else
            //  This is a new page request so only load the combo boxes,
            //  there is nothing else to do
            {
                this.CandidateName.Text = Convert.ToString(Session["CandidateFullName"]);
                LoadElectionCycleList(this.ElectionCycleList);
                LoadPoliticalPartyList(this.PoliticalPartyList);
                LoadCountyList(this.CandidateCountyList);
            }
        }
        else
        {
 
 
            string sCB1 = Convert.ToString(this.ElectionList.SelectedValue);
            string sCB2 = Convert.ToString(this.PoliticalRaceList.SelectedValue);
            string a = "abc";
 
 
        }
    }
 
    protected void ElectionList_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        //  The user-selected Election Cycle value is passed to us so can correctly populate this list
        LoadElectionList(this.ElectionList, e.Text);
    }
 
    private void LoadElectionList2(RadComboBox combobox, string cbval)
    {
        LoadElectionList(this.ElectionList, Request.QueryString["1"]);
        this.ElectionList.SelectedValue = cbval;
    }
    private void LoadElectionCycleList2(RadComboBox combobox, string cbval)
    {
        LoadElectionCycleList(this.ElectionCycleList);
        this.ElectionCycleList.SelectedValue = cbval;
    }
    private void LoadPoliticalRaceList2(RadComboBox combobox, string cbval)
    {
        LoadPoliticalRaceList(this.PoliticalRaceList, Request.QueryString["1"]);
        //LoadPoliticalRaceList(this.PoliticalRaceList, Request.QueryString["15"]);
        this.PoliticalRaceList.SelectedValue = cbval;
    }
    private void LoadPoliticalPartyList2(RadComboBox combobox, string cbval)
    {
        LoadPoliticalPartyList(this.PoliticalPartyList);
        this.PoliticalPartyList.SelectedValue = cbval;
    }
    private void LoadCountyList2(RadComboBox combobox, string cbval)
    {
        LoadCountyList(this.CandidateCountyList);
        this.CandidateCountyList.SelectedValue = cbval;
    }
 
    private void LoadElectionList(RadComboBox combobox, string electioncycleno)
    {
        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ElectronicPetitionSystemConnectionString"].ConnectionString);
        SqlDataAdapter adapter = new SqlDataAdapter("SELECT TOP (100) PERCENT ElectionName, ElectionId, CycleId, ElectionDate FROM dbo.Elections WHERE (CycleId = " + electioncycleno + ") ORDER BY ElectionDate", connection);
         
        DataTable dt = new DataTable();
        adapter.Fill(dt);
        combobox.DataTextField = "ElectionName";
        combobox.DataValueField = "ElectionId";
        combobox.DataSource = dt;
        combobox.DataBind();
        // Insert the first item.
        combobox.Items.Insert(0, new RadComboBoxItem("- Select an election -"));
    }
    protected void ElectList_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        //  The user-selected Election Cycle value is passed to us so can correctly populate this list
        LoadElectionList(this.ElectionList, e.Text);
    }
 
    private void LoadElectionCycleList(RadComboBox combobox)
    {
        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ElectronicPetitionSystemConnectionString"].ConnectionString);
        SqlDataAdapter adapter = new SqlDataAdapter("SELECT CycleId, CycleName FROM Cycles WHERE EndDate > GETDATE() ORDER By CycleName", connection);
        DataTable dt = new DataTable();
        adapter.Fill(dt);
        combobox.DataTextField = "CycleName";
        combobox.DataValueField = "CycleId";
        combobox.DataSource = dt;
        combobox.DataBind();
        // Insert the first item.
        combobox.Items.Insert(0, new RadComboBoxItem("- Select a cycle -"));
    }
 
    protected void PoliticalRaceList_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        //  The user-selected Election Cycle value is passed to us so can correctly populate this list
        LoadPoliticalRaceList(this.PoliticalRaceList, e.Text);
    }
 
    private void LoadPoliticalRaceList(RadComboBox combobox, string electioncycleno)
    {
        if (electioncycleno.Length > 0)
        {
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ElectronicPetitionSystemConnectionString"].ConnectionString);
            string sqlcode = "SELECT Cycles.CycleId, Cycles.CycleName, Cycles.BeginDate, Races.RaceId, Offices.OfficeId, Offices.OfficeDescription FROM Cycles INNER JOIN Races ON Cycles.CycleId = Races.CycleId INNER JOIN Offices ON Races.OfficeId = Offices.OfficeId WHERE Cycles.CycleId = " + electioncycleno + " ORDER BY OfficeDescription";
 
            SqlDataAdapter adapter = new SqlDataAdapter(sqlcode, connection);
            DataTable dt = new DataTable();
            adapter.Fill(dt);
            combobox.DataTextField = "OfficeDescription";
            combobox.DataValueField = "RaceId";
            combobox.DataSource = dt;
            combobox.DataBind();
            // Insert the first item.
            combobox.Items.Insert(0, new RadComboBoxItem("- Select a race"));
        }
    }
 
    private void LoadPoliticalPartyList(RadComboBox combobox)
    {
        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ElectronicPetitionSystemConnectionString"].ConnectionString);
        SqlDataAdapter adapter = new SqlDataAdapter("SELECT PartyId, PartyName, DisplayOrder FROM Parties ORDER By DisplayOrder", connection);
        DataTable dt = new DataTable();
        adapter.Fill(dt);
        combobox.DataTextField = "PartyName";
        combobox.DataValueField = "PartyId";
        combobox.DataSource = dt;
        combobox.DataBind();
        // Insert the first item.
        combobox.Items.Insert(0, new RadComboBoxItem("- Select a party -"));
    }
 
    private void LoadCountyList(RadComboBox combobox)
    {
        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ElectronicPetitionSystemConnectionString"].ConnectionString);
        SqlDataAdapter adapter = new SqlDataAdapter("SELECT CountyId, CountyName FROM Counties ORDER By CountyName", connection);
        DataTable dt = new DataTable();
        adapter.Fill(dt);
        combobox.DataTextField = "CountyName";
        combobox.DataValueField = "CountyId";
        combobox.DataSource = dt;
        combobox.DataBind();
        // Insert the first item.
        combobox.Items.Insert(0, new RadComboBoxItem("- Select a county -"));
    }
 
    protected void CreateButton_Click(object sender, EventArgs e)
    {
        //  Create the new petition if the input validates
        if (Page.IsValid)
        {
            //   If the data entered is valid, then send the user (and the data) to the Confirmation page to make
            //   certain that they actually do want to create the new petition before doing it, otherwise .NET will
            //   send them back to correct the data
            string sQueryString = "";
            sQueryString += "1=" + this.ElectionCycleList.SelectedValue;
            sQueryString += "&2=" + this.PoliticalRaceList.SelectedValue;
            sQueryString += "&3=" + this.PoliticalPartyList.SelectedValue;
            sQueryString += "&4=" + this.CandidateName.Text;
            sQueryString += "&5=" + this.CandidateAddress1.Text;
            sQueryString += "&6=" + this.CandidateAddress2.Text;
            sQueryString += "&7=" + this.CandidateCity.Text;
            sQueryString += "&8=" + this.CandidateState.Text;
            sQueryString += "&9=" + this.CandidateZipCode.Text;
            sQueryString += "&10=" + this.CandidateCountyList.SelectedValue;
            sQueryString += "&11=" + this.ContactName.Text;
            sQueryString += "&12=" + this.ContactPhone.Text;
            sQueryString += "&13=" + this.ContactEmailAddress.Text;
            sQueryString += "&14=" + this.ContactWebSiteURL.Text;
            sQueryString += "&15=" + this.ElectionCycleList.Text;
            sQueryString += "&16=" + this.PoliticalRaceList.Text;
            sQueryString += "&17=" + this.PoliticalPartyList.Text;
            sQueryString += "&18=" + this.CandidateCountyList.Text;
            sQueryString += "&20=" + this.ElectionList.SelectedValue;
            sQueryString += "&21=" + this.ElectionList.Text;
 
            Response.Redirect("NewPetitionConf.aspx?" + sQueryString);
        }
    }
 
    protected void CancelButton_Click(object sender, EventArgs e)
    {
        //  If the user cancels the new petition, then we need to back to MyeDocs.aspx
        Response.Redirect("MyEDocs.aspx");
    }
 
    protected void ValidateURL(object source, ServerValidateEventArgs args)
    {
        args.IsValid = true;
        WebRequest webRequest = null;
        WebResponse webResponse = null;
        try
        {
            webRequest = WebRequest.Create(this.ContactWebSiteURL.Text);
            webResponse = webRequest.GetResponse();
        }
        catch (UriFormatException ex)
        {
            ContactWebSiteURLCustom.ErrorMessage = ex.Message;
            args.IsValid = false;
        }
        catch (WebException ex)
        {
            ContactWebSiteURLCustom.ErrorMessage = ex.Message;
            args.IsValid = false;
            if (ex.Response != null && ex.Response.Headers != null)
            {
                ContactWebSiteURLCustom.ErrorMessage = ex.Message; //+ " - Web Exception - " + ex.Response.Headers.ToString();
                args.IsValid = false;
            }
            ContactWebSiteURLCustom.ErrorMessage = ex.Message; //+ " - \nStack Trace Error - " + ex.ToString();
            args.IsValid = false;
        }
        catch (Exception ex)
        {
            ContactWebSiteURLCustom.ErrorMessage = ex.Message; //+ " - \nStack Trace Error - " + ex.ToString();
            args.IsValid = false;
        }
        finally
        {
            if (webResponse != null)
            {
                webResponse.Close();
            }
        }
 
        Boolean bFlag = args.IsValid;
 
 
    }
 
 
 
 
 
 
 
 
 
 
 
}

Sorry to have to load so much code.  I hope you can give me an idea of how to resolve this problem.

Thanks in advance!

Lynn

Lynn
Top achievements
Rank 2
 answered on 20 Dec 2011
0 answers
150 views
Hi all,
i am new one for RadControls , i want to bind,sort , filter and paging of RadGrid through webmethod and linq, i did this but problem is that how can i fing Linq.Dynamic dll when i am creating query for filtering my code is follow

aspx
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <table class="grid-style-new">
                    <tr>
                        <td>
                            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
                                AllowSorting="True" AllowFilteringByColumn ="True"
                                GridLines="None" AllowCustomPaging="True" AutoGenerateColumns="False" PageSize="5"
                                VirtualItemCount="100000000" ShowFooter="True" EnableViewState="False">
                                <ItemStyle Wrap="false" />
                                <ClientSettings>
                                    <DataBinding Location="ClientSideBindingSortingFiltering.aspx"
                                        SelectMethod="GetCustomers" DataPropertyName="Customers"
                                        FilterParameterType="Linq" SortParameterType="Linq"
                                        CountPropertyName="CustomersCount" FilterParameterName="filterExpressions"
                                        MaximumRowsParameterName="CountRows" SortParameterName="sortExpressions"
                                        StartRowIndexParameterName="startRow" >
                                    </DataBinding>
                                </ClientSettings>
                                <MasterTableView TableLayout="Fixed" EnableViewState="False">
                                    <CommandItemSettings ExportToPdfText="Export to Pdf" />
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID" />
                                        <telerik:GridBoundColumn DataField="CustomerName" HeaderText="Customer Name" />
                                        <telerik:GridBoundColumn DataField="Address" HeaderText="Address" />
                                        <telerik:GridBoundColumn DataField="Phone1" HeaderText="Phone1" />
                                        <telerik:GridBoundColumn DataField="Phone2" HeaderText="Phone2" />
                                        <telerik:GridBoundColumn DataField="Email" HeaderText="Email" />
                                        <telerik:GridDateTimeColumn DataField="CreateDate" DataFormatString="{0:MM/dd/yyyy}"
                                            HeaderText="Create Date" />
                                    </Columns>
                                    <PagerStyle AlwaysVisible="True" />
                                </MasterTableView>
                                <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />
                                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" EnableImageSprites="True">
                                </HeaderContextMenu>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>

webmethod
----------------
     
        [WebMethod]
        public static Dictionary<string,object> GetCustomers(int startRow, int CountRows, string sortExpressions, string filterExpressions)
        {
            var filter = !string.IsNullOrEmpty(filterExpressions);
            var sort = !string.IsNullOrEmpty(sortExpressions);
            var TestDataBase = new TestProgram.DataClasses1DataContext();
            var customers = (from c in TestDataBase.Customers                            
                             select new
                             {
                                 CustomerID = c.CustomerID,
                                 CustomerName = c.CustomerName,
                                 Address = c.Address,
                                 Phone1 = c.Phone1,
                                 Phone2 = c.Phone2,
                                 Email = c.Email,
                                 Fax = c.Fax,
                                 CNIC = c.CNIC,
                                 SalesTaxRegNo = c.SalesTaxRegNo,
                                 CreateDate = c.CreateDate
                             })
                             .Where(filter ? filterExpressions : "CustomerID > 0")
                             .OrderBy(sort ? sortExpressions : "CustomerID ASC");
           
               customers = customers.Skip(startRow).Take(CountRows);
               var count = (filter ? customers.Count() : TestDataBase.Customers.Count());
               return new Dictionary<string, object> { { "Customers", customers }, { "CustomersCount", count } };
        }

in above web mthod where cluse syntax error because linq.Dynamic dll not found
can any one send me code for Declarative Client-Side Binding using linq and web method
kd
Top achievements
Rank 1
 asked on 20 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?