<div class="creditCardForm" style="display:none;">
display:block
const wrapper = document.querySelector(".wrapper"),if(wrapper!= null) {searchInput = wrapper.querySelector("input")}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="aaa.aspx.cs" Inherits="aaa" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:ListBox ID="lstProfLstS1" Width="100%" Height="200px" runat="server" > </asp:ListBox> </div> <script> var Val1 = 'aravind'; var opt1 = document.createElement("option"); opt1.text = Val1; opt1.value = Val1; document.getElementById("lstProfLstS1").options.add(opt1); </script> </form> </body> </html>
OnClientClick="showpopup(this); return false"
List<company> lst = new List<company>(); Address add = new Address () { AddressID = 1, AddressName = "aa"}; lst.Add( new Company (){ CompanyAddress = add , CompanyID = 122, CompanyName = "Code "}); lst.Add(new Company() { CompanyAddress = add, CompanyID = 222, CompanyName = " Project" }); grdTask.DataSource = lst; grdTask.DataBind();
protected void lnkNewBatches() { strStatus = "NewBatches"; grd2.Visible = true; User1 = ViewState["User1"] + ""; DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1); if (dt.Rows.Count > 0) { grd2.DataSource = dt; grd2.DataBind(); } else { grd2.DataSource = null; grd2.DataBind(); } ViewState["SecondStatus"] = "NewBatches"; } protected void lnkRunningbatches() { strStatus = "Runningbatches"; grd2.Visible = true; User1 = ViewState["User1"] + ""; DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1); if (dt.Rows.Count > 0) { grd2.DataSource = dt; grd2.DataBind(); } else { grd2.DataSource = null; grd2.DataBind(); } ViewState["SecondStatus"] = "Runningbatches"; } protected void lnkCompletedBatches() { strStatus = "CompletedBatches"; grd2.Visible = true; User1 = ViewState["User1"] + ""; DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1); if (dt.Rows.Count > 0) { grd2.DataSource = dt; grd2.DataBind(); } else { grd2.DataSource = null; grd2.DataBind(); } ViewState["SecondStatus"] = "CompletedBatches"; } protected void lnkNewBatches_Click(object sender, EventArgs e) { User1 = ((LinkButton)sender).CommandArgument; ViewState["User1"] = User1; lnkNewBatches(); } protected void lnkRunningbatches_Click(object sender, EventArgs e) { User1 = ((LinkButton)sender).CommandArgument; ViewState["User1"] = User1; lnkRunningbatches(); } protected void lnkCompletedBatches_Click(object sender, EventArgs e) { User1 = ((LinkButton)sender).CommandArgument; ViewState["User1"] = User1; lnkCompletedBatches(); }
protected void lnkNewBatches() { strStatus = "NewBatches"; grd2.Visible = true; DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1); if (dt.Rows.Count > 0) { grd2.DataSource = dt; grd2.DataBind(); } else { grd2.DataSource = null; grd2.DataBind(); } ViewState["SecondStatus"] = "NewBatches"; } protected void lnkRunningbatches() { strStatus = "Runningbatches"; grd2.Visible = true; DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1); if (dt.Rows.Count > 0) { grd2.DataSource = dt; grd2.DataBind(); } else { grd2.DataSource = null; grd2.DataBind(); } ViewState["SecondStatus"] = "Runningbatches"; } protected void lnkCompletedBatches() { strStatus = "CompletedBatches"; grd2.Visible = true; DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1); if (dt.Rows.Count > 0) { grd2.DataSource = dt; grd2.DataBind(); } else { grd2.DataSource = null; grd2.DataBind(); } ViewState["SecondStatus"] = "CompletedBatches"; } protected void lnkNewBatches_Click(object sender, EventArgs e) { User1 = ((LinkButton)sender).CommandArgument; lnkNewBatches(); } protected void lnkRunningbatches_Click(object sender, EventArgs e) { User1 = ((LinkButton)sender).CommandArgument; lnkRunningbatches(); } protected void lnkCompletedBatches_Click(object sender, EventArgs e) { User1 = ((LinkButton)sender).CommandArgument; lnkCompletedBatches(); } protected void grd2_PageIndexChanging(object sender, GridViewPageEventArgs e) { grd2.PageIndex = e.NewPageIndex; string Eve1 = ViewState["SecondStatus"].ToString(); if (!string.IsNullOrEmpty(Eve1)) { if (Eve1 == "CompletedBatches") { lnkCompletedBatches(); } else if (Eve1 == "Runningbatches") { lnkRunningbatches(); } else if (Eve1 == "NewBatches") { lnkNewBatches(); } } grd2.DataBind(); }
protected void lnkCompletedBatches_Click(object sender, EventArgs e) { string User1 = ((LinkButton)sender).CommandArgument; ViewState["User1"] = User1; MyFunction(); }
table.AsEnumerable().ToList().ForEach(k => { DateTime temp ; k["DateObjectHide"] = null; if( DateTime.TryParseExact(k["Date"].ToString(), "dd/MM/yyyy", CultureInfo.CurrentCulture, DateTimeStyles.None, out temp){ k["DateObjectHide"] = temp; } } );
string sqlex="select * from Table"; dap=new SqlDataAdapter(sqlex,connectionString); table=new DataTable(); table.Columns.Add(new DataColumn(" ",typeof(bool))); dap.fill(table); table.Columns.Add("DateObjectHide",typeof(DateTime)); datagridview1.DataSource=table; table.AsEnumerable().ToList().ForEach(k => k["DateObjectHide"] = DateTime.ParseExact(k["Date"].ToString(), "dd/MM/yyyy", CultureInfo.CurrentCulture)); dataGridView1.Columns["DateObjectHide"].Visible = false;
using System.Collections.Generic;
[HttpPost] public string SaveAnswer(AnswerVM model) { using(MyDbContext context = new MyDbContext()) { Answer ans = new Answer(); ans.Answer1 = model.Answer; ans.ProjectId = model.ProjectId; ans.QuestionId = model.QuestionId; context.Answers.Add(ans); context.SaveChanges(); } return "test" }
[HttpPost] public string SaveAnswer(AnswerVM model) { return "-" + model.Answer +"-"; }