Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Nafiseh Salmani

@Nafiseh Salmani
About
Posts
134
Topics
66
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem with WebMethod when it is called from Jquery
    N Nafiseh Salmani

    the binding works, the console.log shows that. and the parameters are just numbers, what is wrong with them?> The thing is the page is postback but the webmethod is not running, it only goes to pageload! and One more thing! Sys is not a valid name when I tried to use it!! I don't know why!

    ASP.NET question javascript json help career

  • Problem with WebMethod when it is called from Jquery
    N Nafiseh Salmani

    But with this

    $('.Status').click(function() {
    var divparent = $(this).closest('.tabs-content');
    var ruleid = divparent.attr('data-ruleid');
    var statusid;
    if (divparent.hasClass('inactive')) {
    $(this).closest('.tabs-content').removeClass('inactive');
    statusid = 1;
    }
    else {
    console.log('active');
    $(this).closest('.tabs-content').addClass('inactive');
    statusid = 0;
    }

                $.ajax({ type: "POST", Url: "NewRules.aspx/SaveStatus",
                    data: "{strStatus:'" + statusid + "',strRuleID:'" + ruleid + "'}",
                    contentType: "application/json;charset=utf-8",
                    dataType: "json"
                });
    

    This is not still workingggggggg!!!!!!! pLEASE HELP

    ASP.NET question javascript json help career

  • Problem with WebMethod when it is called from Jquery
    N Nafiseh Salmani

    I thought I changed it :) . thank you so much. this usually happens to me when I am working late.

    ASP.NET question javascript json help career

  • Problem with WebMethod when it is called from Jquery
    N Nafiseh Salmani

    Here is my code:

    $('.Status').click(function() {
    var divparent = $(this).closest('.tabs-content');
    var ruleid = divparent.attr('data-ruleid');
    var statusid;
    if (divparent.hasClass('inactive')) {
    $(this).closest('.tabs-content').removeClass('inactive');
    statusid = 1;
    }
    else {
    console.log('active');
    $(this).closest('.tabs-content').addClass('inactive');
    statusid = 0;
    }

                $.ajax({ type: "POST", Url: "NewRules.aspx/SaveStatus",
                    data: "{strStatus:'" + statusid + "',strRuleID:'" + ruleid + "'}",
                    contentType: "application/json;charset=utf-8",
                    dataType: "json"
                });
    
            });
    

    and here is the WebMethod:

    [WebMethod]
    public static string SaveStatus(string strStatus,string strRuleID)
    {
    int status = int.Parse(strStatus);
    long RuleID;
    if (long.TryParse(strRuleID, out RuleID))
    {

                UploadScheduleDisplay display = UpSchDisp.Where(d => d.Id == RuleID).FirstOrDefault() as UploadScheduleDisplay;
    
                if (display != null)
                {
                    //pause or active the display
                    if (display.IsPaused)
                    {
                        display.Resume();
                    }
                    else
                    {
                        display.Pause();
                    }
                    //command will delete/add the rule from/to the module
                    CommandUtils.SendNewCommandAudit(CommandTypeEnum.ProgramUploadScheduleRules, 0, unitid,
                        1, 0, cmd\_changeStatus, WebMethodLogin);
                }
            }
            else
            { //RuleID is not Valid 
                return "";
            }
            return RuleID.ToString() + "  " +status.ToString();
    

    </pre>

    The Jquery click works, but it never goes to WebMethod, do you have any idea what is wrong with my code?

    Thanks

    ASP.NET question javascript json help career

  • Help me with Jquery
    N Nafiseh Salmani

    this is a jquery question, I am not sure if this is a correct forum to post it though. There is a DIV tag with many elements inside. the div tag has a class to add jquery function to manage mouseover, mouseleave and click event to redirect to another page. everything works great till now. The problem is, now I have to add a button inside the div which should have its own function different from the div click. I would appreciate if anybody can help me. please note that I can't use the elements id, since the div is inside a repeater. here are my Jquery code:

    $('.Status').click(function() {
    $(this).attr('data-redirect', '1');

            });
    
            $('.Highlight').click(function() {
    
                var type = $(this).attr('data-DailyViewType');
                var typeid = $(this).attr('data-editurl');
                var btn\_status = $(this).find('data-redirect');
                if ($(this).hasClass('Status')) {
    
                    alert(1);
                }
    
                if (type != undefined || type != null) {
                    window.location = 'RuleEdit.aspx?DailyRuleTypeID=' + type;
                }
                else {
    
                    if (typeid != undefined || typeid != null) {
                        if (typeid > 0 && btn\_status != 1) {
                            window.location = 'RuleEdit.aspx?id=' + typeid;
                        }
                        else {
    
                        }
                    }
                }
    
            });
            $('.Highlight').mouseover(function() {
                $(this).css('border-left-color', '#FF9900');
                $(this).css('background-color', '#FAFAFA');
    
            });
            $('.Highlight').mouseleave(function() {
                $(this).css('border-left-color', 'White');
                $(this).css('background-color', 'White');
            });
    

    <asp:Repeater ID="RptRulesAndAlerts" runat="server" onitemdatabound="RptRulesAndAlerts_ItemDataBound" > <ItemTemplate> <div class="tabs-content Highlight " align="center" data-editurl='<%# DataBinder.Eval(Container.DataItem, "RuleAlertID") %>'> <asp:Panel ID="RuleAlert" runat="server"> <table cellpadding="7" cellspacing="7" style="border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CDCDCD ; font-size: 11px; "> <tr valign="middle"> <td><asp:Panel ID=

    JavaScript help question javascript css sysadmin

  • onclick is not working
    N Nafiseh Salmani

    I want to create a switch button to turn on and off status. the problem is this button should be inside a repeater. I dont know how to change on to off and how to pass the the required parameter to save the changes to DB. The following code is not working and also it is not complete. here is HTML code :

    <asp:Repeater ID="RptRulesAndAlerts" runat="server"
    onitemdatabound="RptRulesAndAlerts_ItemDataBound" >
    <SeparatorTemplate>
    <br />
    </SeparatorTemplate>
    <ItemTemplate>

    <tr valign="middle">
    <td width="20%" align="center" valign="middle">
    <asp:Panel ID="pnl_status" runat="server" >

     </asp:Panel>
    

    </td>

    </tr>

    </table>
    </asp:Panel>
    </div>

    </ItemTemplate>
    </asp:Repeater>

    I am adding the switch button in code behind:

    protected void RptRulesAndAlerts_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem )
    {
    ISRulesAndAlertsDisplay display = e.Item.DataItem as ISRulesAndAlertsDisplay;

    Panel pnl_status = e.Item.FindControl("pnl_status") as Panel;
    if (display.Status < 0) //show default Rule
    {
    HyperLink showDefaultpops = new HyperLink();
    showDefaultpops.NavigateUrl = "#";
    showDefaultpops.Text = GetLocalResourceObject(display.StatusDescription).ToString();
    showDefaultpops.ID = "libtn_DefaultRule";
    pnl_status.Controls.Add(showDefaultpops);
    }
    else //show the switch button
    {
    var div=new HtmlGenericControl("div");
    div.Attributes["class"]=string.Format("OnOff {0}",(display.Status==1)?"ON" :"OFF" );
    div.Attributes["Title"] = string.Format("Click Here to {0}", (display.Status == 1) ? "OFF" : "ON");

                    var span = new HtmlGenericControl("span");
                    span.Attributes\["class"\]="on"; 
                    span.InnerText="ON";
                    div.Controls.Add(span);
                    if (display.Status == 0) span.Style\["display"\] = "none";
                    
                    span = new HtmlGenericControl("span");
                    di
    
    Web Development html database sysadmin help tutorial

  • Problem with popup confirmation page using ModalExtender
    N Nafiseh Salmani

    I fixed that, thanks. I should delete the

    OkControlID="butConfirmYes"

    ASP.NET help question javascript css sysadmin

  • Problem with popup confirmation page using ModalExtender
    N Nafiseh Salmani

    Thank, it works! but now I have the problem with button

    butConfirmYes

    , since its onclick event doesn't fire! can anyone help me with this?!

    <asp:Button ID="butConfirmYes" runat="server" Text="Countinue" CssClass="styledbutton"
    meta:resourcekey="butCountinue_userCode1"
    onclick="butConfirmYes_Click1" CausesValidation="False"/

    > and in cs file I have

    protected void butConfirmYes_Click1(object sender, EventArgs e)
    {
    context.SelectedCustomer.Unit.Panel.RequestUserCodes();
    ErrorManager.AddMessage((string)GetLocalResourceObject("Error_CommandSent"));

       }
    
    ASP.NET help question javascript css sysadmin

  • Problem with popup confirmation page using ModalExtender
    N Nafiseh Salmani

    Hey, can anybody help me with this? I have the following code, I put the pop-up related part into an empty webform and that works fine, but in the form that I really want to have that, it doesn't work! there is no error showing what is wrong with this! (the script manager is on the master page). Any note or comments to help me to figure out what is wrong with it?! here is the code:

    /*for user code pop-up */
    .confirm-dialog .base
    {
    BORDER-TOP: #ddd 1px solid;BACKGROUND: url(img/base.png) no-repeat left bottom;
    PADDING-BOTTOM: 4px;MARGIN-LEFT: -11px;MARGIN-RIGHT: -11px;
    PADDING-TOP: 4px;TEXT-ALIGN: center;
    }
    .modalBackground
    {
    background-color:Gray;filter:alpha(opacity=70);opacity:0.7;
    }

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    <asp:Content ID="Content2" ContentPlaceHolderID="headerContent" runat="server">
    <script type="text/javascript">
    function Popup()
    {
    var modalPopupBehavior = $find('ModalPopupBehavior1');
    modalPopupBehavior.show();
    }
    </script>
    <style type="text/css">
    .confirm-dialog
    {
    margin-bottom: 0px;
    }
    </style>

    </asp:Content>
    <asp:Content ID="Content1" ContentPlaceHolderID="phBody" runat="server">
    <div class="PageDesc">
    <asp:Localize ID="userCodesPageDescr" runat="server" EnableViewState="False"
    meta:resourcekey="userCodesPageDescrResource1" Text="User Codes enable individual users to arm and
    disarm your security system. Check 'Security Panel Access' to give a user local access so they can arm/disarm
    through the system keypad. Uncheck it to remove local access temporarily - the code will still show
    on the website. (Note that user codes must be 4 digits. Codes 0000 and 0001 are not allowed.)"></asp:Localize>
    </div>
    <div class="PageDesc" align="right">
    <asp:LinkButton ID="lbtnRequestUserCode" runat="server" OnClientClick="Popup()"
    meta:resourcekey="lbtnRequestUserCodeResource1"
    CausesValidation="False">Request Panel User Codes</asp:LinkButton>
    </div>
    <

    ASP.NET help question javascript css sysadmin

  • Problem with a drpdownlist in a datalist
    N Nafiseh Salmani

    I have some problems with a dropdownlist which is in a datalist. the dropdownlist is created statically and has only 4 items from 1 to 4, and it is in each row. when I get the dropdownlist selectedindex all of them just return the default value 0 even if user select another items!! :(( I use the following code to access the dropdownlist and the selectedindex

    DropDownList drp= dstQuestions.Items[i].FindControl("DrpAnswer")as DropDownList ;
    int answer = drp.SelectedIndex + 1;

    (dstQuestions is the name of the DataList.) answer always return 1 !! what is the problem?!

    ASP.NET question help

  • problem with drawing a polygon
    N Nafiseh Salmani

    I want to draw a polygon using Graphic class on a webform, I use the following code but it doesn't show anything!!! :doh:

    protected void Page_Load(object sender, EventArgs e)
    {
    Bitmap objBitmap;
    Graphics objGraphics;

            objBitmap = new Bitmap(400, 440);
            objGraphics = Graphics.FromImage(objBitmap);
            objGraphics.Clear(Color.Blue); 
        }
    

    even I delete all the HTML tag except

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ImageResults.aspx.cs" Inherits="Yadgirandeh.WebForm5" %>;

    I would be really grateful if anybody helps me.

    ASP.NET graphics csharp html help

  • Error: Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized.
    N Nafiseh Salmani

    I use the following code :

    mem.udt_PhonebyMemIDandContactType(memID, null, Txt_MobileNum.Text, null, 4, null);

    the value of Txt_MobileNum.Text is unreachable because of the error "Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized." what is it for? what should i do?!!

    .NET (Core and Framework) question help

  • Problem with windows service!!
    N Nafiseh Salmani

    I run D:\Program Files\Microsoft Visual Studio 9.0\VC>Installutill.exe C:\Winservice\Release\LOG.exe to install windows service ,but The following problem occurred: The Rollback phase completed successfully . The transacted install has completed. The installation failed, and the rollback has been performed. ------------ the installer class is as below:

    public partial class Installer1 : Installer
    {
    //ICCIMLOGService
    ServiceInstaller ITServersLOG;
    ServiceProcessInstaller ICCIMProcessInstaller1;

        public Installer1()
        {
          
                        InitializeComponent();
                        ITServersLOG = new ServiceInstaller();
                        ICCIMProcessInstaller1 = new ServiceProcessInstaller();
                        //process.Account  = ServiceAccount.LocalSystem;
                        ICCIMProcessInstaller1.Account = ServiceAccount.LocalService ;
                        // Service will have Start Type of Manual
                        ITServersLOG.StartType = ServiceStartMode.Manual;
                        ITServersLOG.DisplayName = "ICCIMLOGService";
                        ITServersLOG.ServiceName = ITServersLOG.DisplayName;
                        Installers.Add(ITServersLOG);
                        Installers.Add(ICCIMProcessInstaller1);
               
        }
    }
    

    how can i solve it?!! please help me!! :doh:

    C# help question csharp visual-studio announcement

  • pupup window
    N Nafiseh Salmani

    Please help me!!! I'm really confused by ' and " when use " and when use ' ?!!!!

    ASP.NET javascript sysadmin help question

  • pupup window
    N Nafiseh Salmani

    I can't

    ASP.NET javascript sysadmin help question

  • pupup window
    N Nafiseh Salmani

    Thanks ,but I want to open the page as a pupup!

    ASP.NET javascript sysadmin help question

  • pupup window
    N Nafiseh Salmani

    I want to open an ASPX page as pupup ,using a hyperlink control which is in a gridview . I use the following code but it doesn't work!!!! :doh:

    <asp:HyperLink ID="HyperLink1" runat="server" Font-Bold="True"
    NavigateUrl="javascript:window.open('<%# 'SME/ShowProductDetails.aspx?ARG='+(Eval('URLProduct') +'&Companyurl='+ Eval('URLCompany')).Replace('./?', 'http://www.sme.ir/&') %>','ProductDetails','width=400,Height=400,top=200,left=200' );"
    Text='<%# Eval("Title") %>'></asp:HyperLink>

    help me please!

    ASP.NET javascript sysadmin help question

  • Problem with add linkbutton to a footer of a gridview runtime!!!
    N Nafiseh Salmani

    I use the following code to add linkbutton to footer of a grideview, but it cause error sometimes!!!!! In my computer as local server it works, but another users see the error.

    LinkButton lbtn = new LinkButton();
    lbtn.Text = " |< ";
    Panel pnl = GridView1.FooterRow.FindControl("pnlFooter") as Panel ;
    lbtn.CommandArgument = (pageindex).ToString();
    lbtn.Command += new CommandEventHandler(lbtn_Command);
    pnl.Controls.Add(lbtn);

    the error accurs at line

    Panel pnl = GridView1.FooterRow.FindControl("pnlFooter") as Panel ;

    what could I do to solve it?!!!! :doh: any help would be useful!! HTML For footer gridview:

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AllowPaging="False" GridLines="None" ShowHeader="False" onpageindexchanged="GridView1_PageIndexChanged" ShowFooter="True" FooterStyle-Font-Bold="True">
    <Columns>
    asp:TemplateField
    <ItemTemplate>
    <table style="width:100%">
    <tr>
    <td>

                        <!-- <asp:LinkButton Text='<%# Eval("Title")  %>' ID="libtnGRV" CommandArgument='<%# Eval("URLProduct") +"&Companyurl="+ Eval("URLCompany")%>' runat="server" oncommand="libtnGRVcommand" Font-Bold="True"></asp:LinkButton>-->
                         <!--<a href='<%# Eval("Title")  %>' style="text-decoration: none; font-weight: bold" runat="server"><%# Eval("Title")  %></a>-->
                         <asp:HyperLink ID="HyperLink1" runat="server" 
                                 NavigateUrl='<%# "ShowProductDetails.aspx?ARG="+(Eval("URLProduct") +"&Companyurl="+ Eval("URLCompany")).Replace("./?", "http://www.sme.ir/&") %>' 
                                 Text='<%# Eval("Title") %>' Font-Bold="True"></asp:HyperLink>
                         </td>
                         </tr>
                         <tr>
                         <td>
                         <label runat="server" visible="false"><%# Eval("Price")%></label>
                             
                         </td>
                         </tr>
                         <tr><td>
                     <!--    <a href='<%# Eval("URLCompany") %>' runat=
    
    C# help html sysadmin question

  • I use code to get HTML source of a url , but there is a problem!!!
    N Nafiseh Salmani

    I use the following code to get HTML source of a url , but there is a problem!!!

    public string Gethtmlsourcecode(string url)
    {
    WebResponse response = null;
    WebRequest request = WebRequest.Create(url);
    response = request.GetResponse();
    string data = "";
    if ((response is HttpWebResponse && ((HttpWebResponse)response).StatusCode.ToString() == "OK") ||
    response is FileWebResponse)
    {
    StreamReader sr = new StreamReader(response.GetResponseStream());

            data = sr.ReadToEnd();
        }
        return data;
    
    }
    

    whith this code for url : http://sme.ir/?p=product.profile&ProductID=53834[^] part of data which is an html source of the url should be

    <tr>
    <td class="l lf" width="35%">نام:</td>
    <td class="r rf">
    آماده سازی و بسته بندی قهوه-كاكائو-چای كیسه ای
    </td>
    </tr>
    <tr>
    <td class="l lf">نام‌ قانونی:</td>
    <td class="r rf">
    <a href='http://parstalat.sme.ir'>پارس طلعت</a>
    </td>
    </tr>

    but data is

    <tr>
    <td class="l lf" width="35%">نام:</td>
    <td class="r rf">

    	  </td>
    	</tr>
    					<tr>
    	  <td class="l lf">نام‌ قانونی:</td>
    	  <td class="r rf">
    	 	<a href='http://.sme.ir'></a>
    	  </td>
    	</tr>
    

    you can see some part of HTML source code is not in data!! what should i do to solve this problem?!!!

    ASP.NET html help question

  • how can i develop a program in aspx format and use it in php site?!!
    N Nafiseh Salmani

    I want to write a custom search box like google custom search to use in other site with any platform!! how could it be done to use a C# or dotnet search box in php site?!!

    ASP.NET question csharp php help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups