Click here to Skip to main content
       

ASP.NET

 
GeneralRe: Back Page link with Attachment asp.net 4 Pinmemberεїзεїзεїз19-Nov-12 21:29 
GeneralRe: Back Page link with Attachment asp.net 4 Pinmembern.podbielski19-Nov-12 21:33 
GeneralRe: Back Page link with Attachment asp.net 4 Pinmemberεїзεїзεїз19-Nov-12 23:02 
AnswerRe: Back Page link with Attachment asp.net 4 PinmemberZaf Khan26-Nov-12 9:02 
GeneralRe: Back Page link with Attachment asp.net 4 Pinmemberεїзεїзεїз26-Nov-12 20:49 
GeneralRe: Back Page link with Attachment asp.net 4 PinmemberZaf Khan27-Nov-12 7:55 
Questioncall javascript in button1_click in bihindcode [modified] Pinmemberjojoba201116-Nov-12 22:22 
NewsSOVED ! Pinmemberjojoba201116-Nov-12 23:28 
I solved by adding <base target=_self> to <head> of this (child) page.
 
my code is now this :
 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GridviewGhataKhadamat.aspx.cs"
    Inherits="Tina.WebUI.WorkFlows.Forms.Khadamat.GridviewGhataKhadamat"%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function Close() {
            window.close();
        }
       
        function OK(Id,Name,Code) {
 
            var vReturnValue = new Object();
            vReturnValue.Id = Id;
            vReturnValue.Name = Name;
            vReturnValue.Code = Code;  
            window.returnValue = vReturnValue;
            window.close();
        } 
        
    </script>
<base target=_self>
</head>
<body >
    <form id="form1" runat="server">
    <div>
       <%-- <asp:HiddenField ID="GridviewTypeT" runat="server" />--%>
        <asp:GridView ID="gvGhataKhadamat" runat="server" AutoGenerateColumns="False" BackColor="White"
            BorderColor="#CC9966" BorderStyle="Inset" BorderWidth="1px" CellPadding="4" Font-Names="Verdana">
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <Columns>
                <asp:TemplateField HeaderText="">
                    <ItemTemplate>
                        <input name="rbGhataKhadamat" type="radio" value="<%# Eval("Id") %>,<%# Eval("Name") %>,<%# Eval("Code") %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Id" HeaderText="ID" Visible="false" />
                <asp:BoundField DataField="Code" HeaderText="<%$ Resources:Khadamat, Code %>" />
                <asp:BoundField DataField="Name" HeaderText="<%$ Resources:Khadamat, Name %>" />
            </Columns>
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
        </asp:GridView>
    </div>
    <asp:Button runat="server" ID="btnOk" Text="<%$ Resources:Khadamat, ok %>" UseSubmitBehavior="false"  OnClick="btnOk_Click"/>
    <asp:Button runat="server" ID="btnCancel" Text="<%$ Resources:Khadamat, cancel %>"
        OnClientClick="Close()" />
    </form>
</body>
</html>
 
and bihind code is :
 
protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dtGhataKhadamat = new DataTable();
            string strGridViewType = Request.QueryString["gridname"];
            if (strGridViewType == "Ghata")
            {
                dtGhataKhadamat = tblKhadamatBL.KalaViewSelectByCommandKhadamat("GroupKalaID=15");
                gvGhataKhadamat.DataSource = dtGhataKhadamat;
                gvGhataKhadamat.DataBind();
            }
            else if (strGridViewType == "Khadamat")
            {
                dtGhataKhadamat = tblKhadamatBL.KhadamatTypeSelectAllKhadamat();
                gvGhataKhadamat.DataSource = dtGhataKhadamat;
                gvGhataKhadamat.DataBind();
            }
 

        }
 
        protected void btnOk_Click(object sender, EventArgs e)
        {
 
            string[] strSelected = Request.Form["rbGhataKhadamat"].Split(new char[] { ',' });
            string jsCommand = "OK(" + "'" + strSelected[0] + "','" + strSelected[1] + "','" + strSelected[2] + "'" + ")";
            Page.ClientScript.RegisterStartupScript(GetType(), "OK", jsCommand, true);
 
            //ScriptManager.RegisterClientScriptBlock(Page, typeof(Button), "MyJSFunction", jsCommand, true);

            //Page.ClientScript.RegisterStartupScript(GetType(), "OK", "OK(" + "'" + strSelected[0] + "','" + strSelected[1] + "','" + strSelected[2] + "'"+");", true);
            //Page.ClientScript.RegisterStartupScript(GetType(), "OK", "OK(" + Request.Form["rbGhataKhadamat"] + ");", true);
            //btnOk.OnClientClick = "OK(" + "'" + strSelected[0] + "','" + strSelected[1] + "','" + strSelected[2] + "'" + ");";
            //ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript: OK(" + "'" + strSelected[0] + "','" + strSelected[1] + "','" + strSelected[2] + "'" + ");", true);
            //Page page = HttpContext.Current.CurrentHandler as Page;
            //page.ClientScript.RegisterClientScriptBlock(GetType(), "alert", "OK(" + "'" + strSelected[0] + "','" + strSelected[1] + "','" + strSelected[2] + "'" + ");");
            // btnOk.Attributes.Add("OnClientClick", "javascript:OK(" + "'" + strSelected[0] + "','" + strSelected[1] + "','" + strSelected[2] + "'" + ");");

        }

QuestionMulti tenancy PinmemberFernando "Poorlyte" Girotto16-Nov-12 19:40 
QuestionWhat is this doing Pinmemberrakeshs31215-Nov-12 22:10 
AnswerRe: What is this doing Pinmemberryanb3116-Nov-12 7:41 
QuestionBuilding DOM from xml - asp.net controls, or html controls? Pinmemberlvq68415-Nov-12 21:17 
AnswerRe: Building DOM from xml - asp.net controls, or html controls? Pinmemberjkirkerx16-Nov-12 8:13 
GeneralRe: Building DOM from xml - asp.net controls, or html controls? Pinmemberlvq68418-Nov-12 22:10 
QuestionRe: Building DOM from xml - asp.net controls, or html controls? Pinmembern.podbielski17-Nov-12 1:47 
QuestionChild config files Pinmemberindian14315-Nov-12 16:33 
AnswerRe: Child config files Pinmemberjkirkerx16-Nov-12 8:54 
Questionbind multiple XMLDataSource to one Repeater Pinmemberjrahma15-Nov-12 3:19 
AnswerRe: bind multiple XMLDataSource to one Repeater PinmemberAnurag Gandhi15-Nov-12 21:20 
QuestionAspx control Pinmemberrakeshs31214-Nov-12 21:07 
AnswerRe: Aspx control PinmemberRobert Bettinelli3-Dec-12 15:30 
QuestionCould not load file or assembly Pinmemberxut244714-Nov-12 20:11 
AnswerRe: Could not load file or assembly Pinmemberryanb3116-Nov-12 7:42 
QuestionProblem with foreach loop in MVC 3 Razor View Pinmembersolomon20114-Nov-12 4:09 
AnswerRe: Problem with foreach loop in MVC 3 Razor View Pinmembern.podbielski14-Nov-12 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 11 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid