 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
Hi everyone.
I am well and truly stuck.
I have created a huge list of radio buttons on my razor view. Each row is a different set of radio buttons and I have given them each dynamic names.
I am new to MVC and i did not know how i can pass this radio button list to controller
this is my editor template
@model StudentManagement1.TeacherCourseStudent
@{
ViewBag.Title = "Attendance";
}
<tr>
<td>
@Model.Student_Id
</td>
<td>
@Model.Student.Name
</td>
<td>
@Model.Student.Sur_Name
</td>
<td>
@Model.Student.Semester.Semester_Name
</td>
<td>
@Html.RadioButton(@Model.Student_Id.ToString(), "present", true)
</td>
<td>
@Html.RadioButton(@Model.Student_Id.ToString(), "absent")
</td>
<td>
@Html.RadioButton(@Model.Student_Id.ToString(), "leave")
</td>
and this is my view
@model IEnumerable<StudentManagement1.TeacherCourseStudent>
@{
ViewBag.Title = "MarkAttendance";
Layout = "~/Views/Shared/_TeacherLayout.cshtml";
}
@using (Html.BeginForm("MarkAttendance", "Attendance", FormMethod.Post))
{
<table>
<tr>
<th>
Student Id
</th>
<th>
Name
</th>
<th>
Sur Name
</th>
<th>
Semester
</th>
<th>
Present
</th>
<th>
Absent
</th>
<th>
Leave
</th>
</tbody>
@Html.EditorForModel()
</table>
<br /> <br />
<input type="submit" value="Save attendance" />
}
here my controller to which i want to pass values
[HttpPost]
public ActionResult MarkAttendance(IEnumerable<string> Student_Id)
{
return view();
}
MVC
|
|
|
|
 |
Hi,
I am designing a website. The designing is almost complete.
But I am noticing that there is many images and file is unlinked and in useful.
It is unnecessary present in the project. I would like to remove/delete it. But
it almost impossible to detect these types of files manually, impossible. So is there any way
to find these files ? Please help me.
|
|
|
|
 |
I don't know of any tools to do it other than just manual. I suppose you could search google but since files can be referenced so many different ways, I doubt there is a tool that will work completely.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
That's where the expertise of the web designer comes into play.
I use a folder system for images, various folders that store different images, so it can be contained on a smaller scale.
for example
/images/cnc - contains all the theme and construction parts of the design.
/images/icons - contains all the small pieces of artwork
/images/adPanes - contains all the ad's
Many times, we place a image folder in the content folder, and when the content expires, we delete the whole folder.
/SpecialContent
/SpecialContent/images/image.jpg
/SpecialContent/scripts/js.js
/SpecialContent/index.html
It would be quite a task to organize your files and correct the links for them.
On the flip side, we don't delete many images, unless its a new project, in which we dump unused images before deployment.
|
|
|
|
 |
Hello
I have a Project that Use Very Div Element And Onblur Event In its.
Because Of Security Reason We Switch From a version of JQuery To another .
But We Face With This Problem :
onblur Event dont Fire In Div Element
But it Fire in input elements Like Textbox!!!!!
and also onfocusout Event Fire in dive
but i dont want use this.
<div onblur="alert('dosent work this Event!!!!!')">
any help To solve this Problem can be useful
thanks in advance
|
|
|
|
 |
Literally the first result on Google for "html div onblur":
For blur event to fire on an element, the element needs to receive focus first. But <div> elements do not receive focus by default.
You can add tabindex="0" or contentEditable to your div so it will receive focus.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
 |
Hopefully, I am posting on correct forum.
I have a report with a parameter called loc.
The intended purpose of the report is to allow users to select a location from the dropdownlist and then records associated with that location are displayed to the users.
The dropdownlist is getting populated with values just fine.
However, when I select a location from the dropdownlist, I get an error that says:
Value cannot be null. Parameter name: reportParameters
Everything works fine when I pass a value as textbox but not as dropdown.
Any ideas what I am doing wrong?
Below are relevant code.
'---Dropdownlist control
<asp:Panel runat="server" ID="pnlLoc" Font-Names="Calibri" BorderStyle="Solid" BorderWidth="1" Style="margin: 0 auto; width:300px;">
<table>
<tr>
<td>
<asp:Label runat="server" ID="lblLoc" Text="Location: " />
</td>
<td>
<asp:DropDownList runat="server" ID="ddLoc" DataSourceID="dslocator6" AutoPostBack="True">
</asp:DropDownList>
</td>
</tr>
</table>
</asp:Panel
--Report viewer control
<rsweb:ReportViewer ID="ReportViewer1" runat="server" AsyncRendering="true" SizeToReportContent="true" Font-Names="Arial"
Height="675px" Width="750px">
<LocalReport EnableExternalImages="true" ReportPath="">
</LocalReport>
</rsweb:ReportViewer></center>
<asp:ObjectDataSource ID="LOC" runat="server" SelectMethod="GetData" TypeName="ManageReportsTableAdapters.searchBylocationsTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="ddLoc" Name="Location" DefaultValue=" " />
</SelectParameters>
</asp:ObjectDataSource>
--This code populates the ddLoc dropdownlist
Protected Sub btnLoc_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnLoc.Click
ReportViewer1.LocalReport.ReportPath = ""
pnlLoc.Visible = True
which.Value = "P"
dslocator6.SelectCommand = "SELECT location FROM Locations ORDER BY [location]"
ddLoc.DataTextField = "location"
ddLoc.DataValueField = "location"
End Sub
Sub Run_Report(ByVal sel As String)
ReportViewer1.Reset()
ReportViewer1.LocalReport.DataSources.Clear()
Dim params(0) As ReportParameter
ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("locs", LOC.ID))
ReportViewer1.LocalReport.ReportPath = "locations.rdlc"
ReportViewer1.LocalReport.Refresh()
params(0) = New ReportParameter("loc", sel, False)
ReportViewer1.LocalReport.SetParameters(params) '<-- error points to this line
End Sub
I have been stuck on this for two days. Your assistance is greatly appreciated.
|
|
|
|
 |
This means sel is null. If you debug you should find the issue.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
<asp:DropDownList runat="server" ID="ddLoc" DataSourceID="dslocator6" AutoPostBack="True">
</asp:DropDownList>
in your dropdownlist add listitems
<asp:ListItem Value="location">Location
|
|
|
|
 |