Hello All,
I am developing application in mvc3.Here is my issue.
I have a webgrid,in that when i click on one column one popup will be dispalyed.here when i click on that link in the url # symbol is adding.how to remove that # symbol in url.
Thanks in advance.
srujana thallamPosted Aug 18, 2014, 6:45 AM
public int UpdateCofirmationEmail(ServiceCatlogResult popupvalues)
{
String results = String.Empty;
int updatedRows = 0;
SqlParameters inputParams = new SqlParameters();
inputParams.query = String.Format(Queries.SC_Update_ConformEmail, helper.GetDBPrefix());
inputParams.AddParam("ConfromEmail", popupvalues.selconformemail, OdbcType.Char);
inputParams.AddParam("ServiceName", popupvalues.selEmailServiceName, OdbcType.Char);
try
{
string environment = "DEV";
updatedRows = dbHelper.ExecuteUpdate(helper.GetConnectionStr(environment), inputParams);
}
catch (OdbcException ex)
{
helper.LogODBCException(ex);
}
return updatedRows;
}
parameters are passing and its working fine.only the problem is # is adding in url
Sasi ReddyPosted Aug 18, 2014, 6:35 AM
whether the parameters are passing or
srujana thallamPosted Aug 18, 2014, 6:30 AM
I tried with Actionlink,but when I work with the parameters are not passing from grid to popup thats why i used select link.
I am sending my complete code.please check this.
@model System_Hierarchy_Information_Portal.Models.ServiceCatlogResult
@{
Layout = null;
}
@{
System_Hierarchy_Information_Portal.Models.ServiceCatlogResult result_demo = new System_Hierarchy_Information_Portal.Models.ServiceCatlogResult();
}
<!DOCTYPE html>
<html>
<head>
<title>ServiceCatalogResultstitle>
head>
<body>
<div id="AudExceptGrid" style="overflow-x:scroll; width: auto ;">
<br />
@Model.grid.GetHtml(htmlAttributes: new { id = "audit_table_grid" },
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "webgrid-alternating-row",
selectedRowStyle: "selected",
rowStyle: "webgrid-row-style",
columns: Model.grid.Columns
(
Model.grid.Column(columnName: "Job_Name", header: "Service Name"),
Model.grid.Column(columnName: "Source_System", header: "Source system"),
Model.grid.Column(columnName: "Source_Agent", header: "Source Agent"),
Model.grid.Column(columnName: "Target_System", header: "Target Sytem"),
Model.grid.Column(columnName: "Target_Agent", header: "Target Agent"),
Model.grid.Column(columnName: "Source_Directory", header: "Source Directory"),
Model.grid.Column(columnName: "Target_Directory", header: "Target Directory"),
Model.grid.Column(columnName: "Archive_Directory", header: "Archive Directory"),
Model.grid.Column(columnName: "Source_q", header: "Source Queue"),
Model.grid.Column(columnName: "Target_q", header: "Target Queue"),
Model.grid.Column(columnName: "Job_Schedule", header: "Job Schedule"),
Model.grid.Column(columnName: "Trigger", header: "Trigger"),
Model.grid.Column(columnName: "Job_priority", header: "Job priority"),
Model.grid.Column(columnName: "Exits", header: "Exits"),
Model.grid.Column(columnName: "Rule_ Description", header: "Rule Description"),
Model.grid.Column(columnName: "Confirmation_email", header: "Confirmation e-mail", format: @ <div id='ConformMail' onclick="showALL()">@item.GetSelectLink(item.Conformation_email)div>),
Model.grid.Column(columnName: "Failure_email", header: "Failure e-mail", format: @ <div id='failureMail' onclick="showALL1()">@item.GetSelectLink(item.Failure_email)div>)
)
)
@{
if (!(Model.totalRecords > 0))
{
<h3>NO RESULTSh3>
}
else
{
<p>Total Records Returned: @Model.totalRecordsp>
}
}
@if (Model.grid.HasSelection)
{
var result_demo1 = Model.grid.Rows[Model.grid.SelectedIndex].Value;
var res = Newtonsoft.Json.JsonConvert.SerializeObject(result_demo1);
System_Hierarchy_Information_Portal.Models.JsondataVal tmp = Newtonsoft.Json.JsonConvert.DeserializeObjectJsondataVal>(res);
<div id="overlay" class="web_dialog_overlay">div>
<div id="dialog" class="web_dialog">
<table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0" class="table-no-borders">
<tr class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
<td align="left" >Edit Notification Emailtd>
<td align="right">
<a href="#" id="btnClose" onclick="HideDialog()">Xa>
td>
tr>
<tr>
<td> td>
<td> td>
tr>
<tr>
<td> td>
<td> td>
tr>
<tr>
<td>
ServiceName
td>
<td>
@Html.TextBoxFor(FTE => FTE.selEmailServiceName, new { @Value = @tmp.Job_Name, @readonly = "readonly" })
td>
tr>
<tr>
<td>
Confirmation Email
td>
<td>
@Html.TextBoxFor(FTE => FTE.selconformemail, new { @Value = @tmp.Conformation_email })
td>
tr>
<tr>
<td> td>
<td> td>
tr>
<tr>
<td colspan="2" style="text-align: center;">
<input id="btnUpdate" type="button" value="Update" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" onclick="EditEmail()"/>
<input id="btnCancel" type="button" value="Cancel" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" onclick="HideDialog()"/>
td>
tr>
table>
div>
}
div>
<div id="test1"> div>
@*start script for pop up design*@
<style type="text/css">
.web_dialog_overlay
{
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
background: #000000;
opacity: .15;
filter: alpha(opacity=15);
-moz-opacity: .15;
z-index: 101;
display: none;
}
.web_dialog
{
display: none;
position: fixed;
width: 380px;
height: 200px;
top: 50%;
left: 50%;
margin-left: -190px;
margin-top: -100px;
background-color: #ffffff;
border: 2px solid #336699;
padding: 0px;
z-index: 102;
font-family: Verdana;
font-size: 10pt;
}
.web_dialog_title
{
border-bottom: solid 2px #336699;
background-color: #336699;
padding: 4px;
color: White;
font-weight:bold;
}
.web_dialog_title a
{
color: White;
text-decoration: none;
}
.align_right
{
text-align: right;
}
style>
@* End script for pop up design*@
<script type="text/javascript">
function showALL() {
setTimeout(function () {
ShowDialog(true);
}, 1000);
}
function EditEmail() {
var jsonObj = {
selconformemail: ifNoValReturnEmptyString('selconformemail'),
selEmailServiceName: ifNoValReturnEmptyString('selEmailServiceName')
};
$.ajax({
url: '@Url.Action("UpdateCofirmationEmail", "FTE")',
type: 'GET',
data: jsonObj,
dataType: 'html',
cache: false,
success: function (data) {
if (data != null) {
HideDialog();
e.preventDefault();
}
}
});
}
function ShowDialog(modal) {
$("#overlay").show();
$("#dialog").fadeIn(300);
if (modal) {
$("#overlay").unbind("click");
//alert("1");
}
else {
$("#overlay").click(function (e) {
HideDialog();
});
}
}
function HideDialog() {
$("#overlay").hide();
$("#dialog").fadeOut(300);
//window.opener.location.reload(true);
$.ajax({
url: '@Url.Action("PageLod_Grid", "FTE")',
type: 'GET',
async: true,
dataType: 'html',
cache: false,
success: function (data) {
$('#result_Service_Catalog_grid').replaceWith(" ");
$('#results_FTE_div').replaceWith(data);
}
});
}
script>
body>
html>
Sasi ReddyPosted Aug 18, 2014, 6:22 AM
grid.Column("MakeAppointment",format: @
new { PatientId=item.PatientId,DoctorId=item.DoctorId,Complaint=item.Complaint}, new { @class = "popupLink" })
srujana thallamPosted Aug 18, 2014, 6:14 AM
Model.grid.Column(columnName: "Confirmation_email", header: "Confirmation e-mail", format: @
function showALL() {
//code to open popup based on div id
}
Bhavik PatelPosted Aug 18, 2014, 6:12 AM
Click to open
this will stop generating # behind your web page url
Sasi ReddyPosted Aug 18, 2014, 6:05 AM