I am saving PDF files for Employee with HttpPostedFilebase where the path of the pdf will be saved in the database. Now I want to display the PDF in a div, not the download link. For showing image, I have done <img src=@Url.Content(Model.employee_image) />. How can I do the same for Displaying PDF?
...I am using Ajax.BeginForm in Modal pop-up, but when submitting form values, it is calling controller twice and hence saving the same form details twice in the database, what can be the cause of it, i am not able to find any good solution on internet, I am using PartialView in ActionMethod to return Ajax.Beginform view
Here is the PartialView code
...Hi, I want to pass multiple checkbox values for deleting data like
checkbox1: a,b,c,d checkbox2: e,f,g,h
and pass it to the controller and want to show modal popup before sending Data to the controller:
Are you sure, you are going to delete 2 items? (Delete/No)
the modal pop-up will contain the only count of selected data and delete button for confirmation?
Delete button will delete all selected data
should I pass the data in JSON format or in the string?
Right now, I am passing the data like : var a = {values = CommaSeperatedValues}
In the controller Method passing argument as List<string> values
and fetched values but I am getting an error like unexpected char at JSON
Hi, I would like to know how can I send or push notification to the user to the browser using asp.net web forms? Something like the below image
...
How to integrate SSRS with MVC from scratch?
...Hello Guys !!
I have already asked the same question but now I am again asking with the new requirement, so please read carefully and solve my issues.
My Requirement:
Explaining my Requirement
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="N-level-Treeview.aspx.cs"
Inherits="N_level_Treeview" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TreeView ID="TreeView1" runat="server" ImageSet="XPFileExplorer" NodeIndent="15">
<HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="2px"
NodeSpacing="0px" VerticalPadding="2px"></NodeStyle>
<ParentNodeStyle Font-Bold="False" />
<SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
VerticalPadding="0px" />
</asp:TreeView>
</div>
</form>
</body>
</html>?
: - I have a table and there are Srno,PId, Pname, CID, CName,Cqty columns in my table.
Suppose if CID is also in PID column, Node must be created on that CID and also must have expand button to show the child of that cID.
What i have done in coding let's see...
CS--------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class N_level_Treeview : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = this.GetData("SELECT cId, cName FROM TopBill");
this.PopulateTreeView(dt, 0, null);
}
}
private void PopulateTreeView(DataTable dtParent, int parentId, TreeNode treeNode)
{
foreach (DataRow row in dtParent.Rows)
{
TreeNode child = new TreeNode
{
Text = row["cName"].ToString(),
Value = row["cId"].ToString()
};
if (parentId == 0)
{
TreeView1.Nodes.Add(child);
DataTable dtChild = this.GetData("SELECT srNo,cid, cName FROM TopBill WHERE pid = " + child.Value);
PopulateTreeView(dtChild, int.Parse(child.Value), child);
}
else
{
treeNode.ChildNodes.Add(child);
}
}
}
private DataTable GetData(string query)
{
DataTable dt = new DataTable();
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(query))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
sda.SelectCommand = cmd;
sda.Fill(dt);
}
}
return dt;
}
}
}
-------------- Current Output of my Code is ...
...
I have an action where I am putting zip files and those zipped files are unzipped. Now, the problem is, when I am unzipping those files....those files are saved into the App_Data folder in a weird format. Note that, I am saving the directory path as the string in my database table(img1).
...
Hello Guys !!
Actually, My Requirement is to create a Gridview dynamically and bind data in grid view and generating another gridview same time on the previous grid view row again and again...
1.Binding Gridview Dynamically from code Behind In asp.net from database table
2.Generating another Gridview on from above gridview row index if data find.
My Code
...How to do autologin in MVC and which is the best method to securely save Cookies in asp.net MVC?
please help
...how to implement remember me functionality in mvc?
is it secure to use cookies for this?
...