|
I mean i want to select the data from grid view from each row and other thing i want that is the form of that perticlur grid filled automatically so that i can edit it and update the data . hope u got me all of u Please help me
i know grid view has a select button so that each row is selected i want selected data in form not in grid view
|
|
|
|
|
|
In a vb.net 2010 web form application, there is the following line of code in a
gridview control.
<asp:TemplateField HeaderText="Student Name" ItemStyle-HorizontalAlign="Center"
ItemStyle-CssClass="ui-widget-content" >
<ItemTemplate >
<a href="javascript:
GetStudentLetterTemplate('<%# Eval("schoolyear") %>', '<%# Eval("schoolnum")
%>', '<%# Eval("milestone_code") %>', '<%# Eval("stulink") %>', '<%#
Eval("HOMELNGCOR") %>', '<%# Eval("semester") %>');"
style="color:Blue"><%#Eval("STUDENTNAME")%></a>
</ItemTemplate>
</asp:TemplateField>
When the user clicks on this link, the user is directed to some javascript code
called GetStudentLetterTemplate.
Once in the javascript function, I want to display an error message to the user
saying basically saying there is duplicate data in the database. I want to then
want the function to 'return' so no processing by the user can occur. Note: the
duplicate data is created by the user by them using vendor software that I have
no control over.
The sql that I want to use is something like the following:
#Region "Public Shared Function GetDupScoolYear"
<WebMethod()> _
Public Shared Function GetDupScoolYear() As DataTable
Dim _dt As DataTable = New DataTable()
Dim Query As String = "SELECT [personID],value, count(*) as Count FROM
[t].[dbo].[CustomStudent] where attributeID = 2775 and [personID] = 97366 group
by [personID],value"
Using con As SqlConnection = DB.OpenConnection()
Using da As SqlDataAdapter = New SqlDataAdapter(Query, con)
Try
da.Fill(_dt)
Catch ex As Exception
End Try
End Using
End Using
Return _dt
End Function
#End Region
Thus can you tell me or show me what I can do to solve the problem? Is there
possibly someway that I could call the code I listed above or similar code
before the java script code is called?
Basically would you tell me what I can do to solve this issue?
modified 23-Aug-16 22:22pm.
|
|
|
|
|
I have thousands of user who are accessing my site, How should I handle a load ?
|
|
|
|
|
|
Thanks deepankarbhatnagar for your reply
I need some more details like at IIS level how can I handle it ?.
|
|
|
|
|
|
|
|
I need to make multiple insert to multiple table have relation with each other
all id in all table is identity and already do model relation ef to it
in visual studio 2015
what i need actually when user click submit
Save the following data
Name,Email,Salary,DistrictId in table Employee
EmployeeId,CourseId in table EmployeeCourse
EmployeeId,LanaguageId,LevelId in table EmployeeLangage
what i write in create function in empcourse controller
my custom model as following
[code]
public class Customemployee
{
public string Name { get; set; }
public string Salary { get; set; }
public string Email { get; set; }
public int DistrictId { get; set; }
public List<empcourse> Courses { get; set; }
public List<emplangauge> Langs { get; set; }
}
public class Empcourse
{
public int Id { get; set; }
public int EmployeeId { get; set; }
public int CourseId { get; set; }
}
public class Emplangauge
{
public int Id { get; set; }
public int LevelId { get; set; }
public int LanguageId { get; set; }
}
}
[/code]
my controller empcourse is
[code]
public class empcourseController : Controller
{
mycourseEntities db = new mycourseEntities();
// GET: empcourse
public ActionResult Index()
{
return View();
}
public ActionResult Create()
{
ViewBag.CountryId = new SelectList(db.Countries.ToList(), "Id", "CountryName");
ViewBag.LanaguageId = new SelectList(db.Languages.ToList(), "Id", "LnaguageName");
ViewBag.LevelId = new SelectList(db.Levels.ToList(), "Id", "LevelName");
ViewBag.CourseId = new SelectList(db.Courses.ToList(), "Id", "CourseName");
return View();
}
[HttpPost]
public ActionResult Create(Customemployee cemp)
{
return View();
}
public JsonResult getcitybyid(int id)
{
db.Configuration.ProxyCreationEnabled = false;
return Json(db.Cities.Where(a => a.CountryId == id), JsonRequestBehavior.AllowGet);
}
public JsonResult getdistrictbyid(int id)
{
db.Configuration.ProxyCreationEnabled = false;
return Json(db.Destricts.Where(a => a.CityId == id), JsonRequestBehavior.AllowGet);
}
}
}
[/code]
my Create view is
[code]
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Create</title>
<script src="~/scripts/jquery-1.10.2.js"></script>
<script>
$(function () {
$("#CountryId").change(function () {
$("#citylist").empty();
var x = $(this).val();
$.ajax({
url: "/empcourse/getcitybyid",
data: { id: x },
success:function(res)
{
$.each(res, function (i, e) {
$("#citylist").append("<option value='" + e.Id + "'>" + e.CityName + "<option>")
});
}
});
});
$("#citylist").change(function () {
$("#districtlist").empty();
var y = $(this).val();
$.ajax({
url: "/empcourse/getdistrictbyid",
data: { id: y },
success: function (res) {
$.each(res, function (i, e) {
$("#districtlist").append("<option value='" + e.Id + "'>" + e.DistrictName + "<option>")
});
}
});
});
$("#CourseId").change(function () {
var index = 0;
var id = $(this).val();
var txt = $("#CourseId option:selected").text();
$("#tb").append("<tr><td><input type = 'hidden' name='Courses[" + index + "].CourseId' value='" + id + "'/></td><td>" + txt + "</td><td><input type='button' value='remove' class='r'</td></tr>")
index++;
});
$("#tb").on("click", ".r", function () {
$(this).parent().parent().hide();
$(this).parent().prev().prev().find("input").val("0");
});
$("#LanaguageId").change(function () {
var index1 = 0;
var id1 = $(this).val();
var txt1 = $("#LanaguageId option:selected").text();
$("#tb1").append("<tr><td><input type = 'hidden' name='Langs[" + index1 + "].LanguageId' value='" + id1 + "'/></td><td>" + txt1 + "</td><td><input type='button' value='remove' class='s'</td></tr>")
index1++;
});
$("#tb1").on("click", ".s", function () {
$(this).parent().parent().hide();
$(this).parent().prev().prev().find("input").val("0");
});
$("#LevelId").change(function () {
var index2 = 0;
var id2 = $(this).val();
var txt2 = $("#LevelId option:selected").text();
$("#tb2").append("<tr><td><input type = 'hidden' name='Langs[" + index2 + "].LevelId' value='" + id2 + "'/></td><td>" + txt2 + "</td><td><input type='button' value='remove' class='y'</td></tr>")
index2++;
});
$("#tb2").on("click", ".y", function () {
$(this).parent().parent().hide();
$(this).parent().prev().prev().find("input").val("0");
});
});
</script>
</head>
<body>
<div>
@using (Html.BeginForm())
{
<div>
Name:@Html.TextBoxFor(a=>a.Name)
<br />
Salary:@Html.TextBoxFor(a => a.Salary)
<br />
Email:@Html.TextBoxFor(a => a.Email)
<br />
Country:@Html.DropDownList("CountryId")
<br />
City:<select id="citylist" name="CityId"></select>
<br />
District:<select id="districtlist" name="DistrictId"></select>
<br />
Courses:@Html.DropDownList("CourseId")
<br />
<br />
<table id="tb"></table>
<br />
<br />
Language:@Html.DropDownList("LanaguageId")
<br />
<br />
<table id="tb1"></table>
<br />
<br />
Level:@Html.DropDownList("LevelId")
<br />
<br />
<table id="tb2"></table>
<br />
<input type="submit" />
</div>
}
</div>
</body>
</html>
[/code]
my interface and Relation diagram found in this link
http://www.mediafire.com/view/mn44bl69zkrjukp/Interface3.jpg
|
|
|
|
|
can you help me
what i need actually insert
Save the following data
Name,Email,Salary,DistrictId in table Employee
EmployeeId,CourseId in table EmployeeCourse
EmployeeId,LanaguageId,LevelId in table EmployeeLangage
and write it in Create
http post
[HttpPost]
public ActionResult Create(Customemployee cemp)
{
return View();
}
|
|
|
|
|
In a vb.net 2010 web form application, I want to display a message to the user when a student has more than one record in the database for the current school year. The database problem is caused by a user not entering the data correctly using vendor software. The user can fix the problem by using the vendor software. The database problem is only allowed to be updated by the user by using the vendor software.
My goal is to generate the message to be displayed in the same format in the two locations where this message needs to be displayed.
**Note: I can not change the locations of where the error messages need to be generated without needing to do a major rewrite of the application.
I would prefer for the javacript code to be able to place the message in _master.ErrorMessage of the master page.
However my second choice would be for the vb.net 2010 web form code to be able to generate the javacript alert message.
The following 2 places is the code that I know works right now:
1. The following is vb.net 2010 web form code using the error message in the Mater Pages:
If (gvAttendanceLetters.DataKeys(0).Values(3) = "999") Then
_master.Visible = True
_master.ErrorMessage = "You have entered more the one record for the current school year for the student you selected "
End If
2. The following is javacript code that is placed at the start of the default.aspx page:
function GetStudentLetterTemplate(scyear, scnum, milestone, studentnum) {
if (milestone == '999') {
alert('You have entered more the one record for the current school year for the student you selected ');
}
});
}
Thus would you me tell me what option would work along with the code that will solve the problem? If the code needs to stay the way,
I listed above just let me know.
|
|
|
|
|
Can you let us know which method in master pages you have the code. Some methods execute only once and some executed every time. For example , PostBack do not go though all the methods in page lifecycle.
JavaScript is fine but in personally I would prefer master pages.
|
|
|
|
|
 Is there any way that a reference to the master page can be setup uniquely for a single web page? If so, how would you setup that code?
Here is the code I am thinking you wanted to see:
Imports System.Data
Imports System.Reflection
Imports System.Windows.Forms
Imports Telerik.Web.UI
Imports System.Web.Script.Services
Imports System.Web.Script.Serialization
Imports System.Web.Services
Partial Class attendanceletters_default
Inherits System.Web.UI.Page
Protected _master As MasterPage
Protected _schoolyear As Integer
#Region "Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
_master = CType(Page.Master, MasterPage)
_master.PageTitle = "Attendance"
Dim schoolDate As DateTime = Today()
Dim schoolMonth As Integer = schoolDate.Month
Dim schoolYear As Integer = schoolDate.Year
If schoolMonth >= 8 And schoolMonth <= 12 Then
_schoolyear = schoolDate.AddYears(1).Year
ElseIf schoolMonth >= 1 And schoolMonth <= 7 Then
_schoolyear = schoolDate.AddYears(0).Year
End If
If Request.UrlReferrer IsNot Nothing Then
SiteUserManager.SessionUser.SiteUri = Request.UrlReferrer
End If
If Not Page.IsPostBack Then
If (SiteUserManager.SessionUser IsNot Nothing) Then
LoadSchools()
If ddlSchools.SelectedValue <> "" Then
LoadMilestones(ddlSchools.SelectedValue)
GetGrdiviewData()
End If
End If
End If
Response.Cache.SetExpires(DateTime.Now())
Response.Cache.SetCacheability(HttpCacheability.NoCache)
End Sub
#End Region
|
|
|
|
|
Yes you can assign a different master page to a specific page programmatically.
|
|
|
|
|
In a vb.net 2010 webform application, I am going to display a popup javascript alert message for the user when there are 2 records in the database for the current school year for each unique student. This popup message is displayed since the user needs to update the database using vendor software.
For the javacript alert message, I have the following questions:
1. At the top the alert message, it says 'Message from Web Page' since that is probably the default value. Is there a way that I can change this message to something I want? If so, how can I change the message?
2. I am wondering what if there maximum length that I can display in the error message? If so, what is the maximum length?
3. Can I extend the maximum size of the message and if so, can you show me how to extend the size of the error message?
4. Can I change the display icon to be an error instead of a warning? If so, how would I accomplish this goal?
|
|
|
|
|
|
1 No
2 & 3 None but if the message gets too big it is unreadable
4 No
Alert has no real use outside of debugging, if you want to show a "popup" or modal message then look at a jQuery plug-in for it. jQuery UI comes with one but there are many others if you google "jquery modal plug-in".
|
|
|
|
|
OK, WTF is going on here?
Your question is an exact copy of this other question[^], posted by a different user.
At first I thought yours was the original, since the other message looks like it's been copied from somewhere. Then I checked the timestamp - your message was posted eight hours after the other copy.
If you own both accounts, then one or both is a "sock-puppet" account, which is considered abuse.
If you don't, then you've reposted someone else's question, which is also abuse.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
And he's been doing this for nearly five years.
|
|
|
|
|
|
I have this report to write, it's content is company information and then sales numbers for months for 5 years below the company information
eg.
ABC Company John 714-555-1212 ATD: $1.00 Balance: $0.00
Year Jan Feb March
2016 $1.00 $2.00 $3.00
2015 $2.00 $1.00 $5.00
2014 $3.00 $2.00 $1.00
So I'm using Dataset and DataTable to build the data
I created 2 tables
Dim rs_CR As DataTable = New DataTable()
rs_CR.TableName = "dt_customerRecords"
rs_CR.Columns.Add(New DataColumn("ID", System.Type.GetType("System.String")))
rs_CR.Columns.Add(New DataColumn("Name", System.Type.GetType("System.String")))
rs_CR.Columns.Add(New DataColumn("FName", System.Type.GetType("System.String")))
rs_CR.Columns.Add(New DataColumn("LName", System.Type.GetType("System.String")))
rs_CR.Columns.Add(New DataColumn("Phone", System.Type.GetType("System.String")))
rs_CR.Columns.Add(New DataColumn("Fax", System.Type.GetType("System.String")))
rs_CR.Columns.Add(New DataColumn("ATD", System.Type.GetType("System.Decimal")))
rs_CR.Columns.Add(New DataColumn("Balance", System.Type.GetType("System.Decimal")))
I want to add another something here to join the table below. In the RDLC using a Tablix, I can only have 1 dataset. If I create 2 datasets, the dataset prints after the data above, and is not part of the set above.
Dim rs_RP As DataTable = New DataTable()
rs_RP.TableName = "dt_reportData"
rs_RP.Columns.Add(New DataColumn("Year", System.Type.GetType("System.Int32")))
rs_RP.Columns.Add(New DataColumn("P1", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P2", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P3", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P4", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P5", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P6", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P7", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P8", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P9", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P10", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P11", System.Type.GetType("System.Decimal")))
rs_RP.Columns.Add(New DataColumn("P12", System.Type.GetType("System.Decimal")))
Dim ds_CR As DataSet = New DataSet()
ds_CR.DataSetName = "ds_customerRecords"
ds_CR.Tables.Clear()
ds_CR.Tables.Add(rs_CR)
ds_CR.Tables(0).TableName = "tablix_customerRecords"
rv_Canvas.LocalReport.DataSources.Clear()
rv_Canvas.LocalReport.DataSources.Add(New ReportDataSource("ds_customerRecords", ds_CR.Tables(0)))
rv_Canvas.LocalReport.Refresh()
As a caveat, I'm getting the data from an old Foxpro database that is not quite SQL
|
|
|
|
|
Hi,
Please tell me the how to implement the pkcs in ASP.NET .
|
|
|
|
|
I would, but can't see the connection between ASP.NET and encryption...
System.Security.Cryptography.Pkcs Namespace[^]
(Google is your friend)
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
I have tried many steps like uninstall NuGet pakeged and than restart the Visual studio and than again i install the pakeges .
I have tried another solution which is
Press Windows + R
Enter appwiz.cpl and press Enter
Right-click the entry "Microsoft Visual Studio Express 2015 for Web" and click "Repair"
(This is going to reinstall all packages that you have uninstalled, because you weren't needing them (eg. Microsoft SQL Server Native Client)
|
|
|
|
|