MVC :: Add Multiple Values To Viewdata
May 27, 2010
I have one ActionResult method
[Code]....
This ActionResult is executed multiple time accoording the number user selected from previous page..each and every student id and StudentType is passed by that view to this ActionResult. my question is there any way that in ViewData we can store all these id's and studentType's so that I can use these id' and StudentType's in other ActionResult? bec I need only these two things in other ActionResult? I can implement this using cache but I dont want to do with that.
View 2 Replies
Similar Messages:
May 11, 2010
i need to pass multiple viewdata to a partial view from controller
View 7 Replies
May 7, 2015
i showed two column (Electronics,Photoshop) but i have six. i want to update their checked or unchecked condition in database (0,1) how do i do?
<asp:CheckBox ID="CheckBox1" runat="server" Text="Electronics" />
<asp:CheckBox ID="CheckBox2" runat="server" Text="Photoshop" />
<asp:CheckBox ID="CheckBox3" runat="server" Text="VideoEditing" />
<asp:CheckBox ID="CheckBox4" runat="server" Text="Gaming" />
<asp:CheckBox ID="CheckBox5" runat="server" Text="Coding" />
<asp:CheckBox ID="CheckBox6" runat="server" Text="Miscellaneous" />
View 1 Replies
Oct 5, 2010
i have multiple tables .
I have created one stored procedure where I am selecting the table values.
like
[code]....
I am using LINQ to retrieve the Data. So Using Linq I am calling the stored procedure.
So I ll get the table values in the C# Code the table values.
so in my UI i have 4 gridviews.
I want split the output values into four source and bind it to the grid.
View 1 Replies
Feb 3, 2010
Below is the jquery script that takes one input value from textBox1 and pass it to a web method then returns the name of the person and displays it in textBox2. The web method only takes one parameter, the user initials.
[code]....
I want to be able to pass two values from two textboxes for a web method that requires two parameters. how can I modify the jquery code above to accomplish that?
View 4 Replies
Nov 29, 2010
have managed to pass all three values for instance to a label. Now however I need to pass the three IDs to create a gridview for the three values... So for my SQL statement I have:
SelectCommand="SELECT [BookID], [book_title] FROM [tblBook] WHERE ([BookID] = ?)">
So I need there to be 3 BookID=?,?,? for instance, is this possible?
Or is there another way to do it in ASP?
View 3 Replies
Aug 2, 2010
I have a checkboxlist on a form and need to find out howI go about finding the values of the ones that might be checked .
<asp:CheckBoxList ID="cbSpillCleanUp" runat="server">
<asp:ListItem Value="EmergencyResponse">911/Police/Fire</asp:ListItem>
<asp:ListItem Value="CentralStation">Central Station</asp:ListItem>
<asp:ListItem Value="ERV">Environmental Response Vendor</asp:ListItem>
<asp:ListItem Value="RegAgency">Regulatory Agency</asp:ListItem>
</asp:CheckBoxList><br />
View 2 Replies
May 12, 2010
I'm trying to use ConfigurationManager.AppSettings.GetValues() to retrieve multiple configuration values for a single key, but I'm always receiving an array of only the last value. My appsettings.config looks like
<add key="mykey" value="A"/>
<add key="mykey" value="B"/>
<add key="mykey" value="C"/>
etValues("mykey");
View 4 Replies
Oct 7, 2010
I have a report, in this report I have link to other report to generate the PDF versions. It all works except when I pass multiple values from the a dropdown parameters. Here is what I have tried, the first one works, but only returns the first users information, it ignores 1074 and 1106.
Expression: ="balbla...rs:Command=Render&StartDate=" & First(Fields!ThirtyOneDaysAgo.Value, "GetDates") & "&EndDate=" & Today & "&UserID=" & cstr(join(Parameters!UserID.Value, "&UserID="))
Renders: &rs:Command=Render&StartDate=9/6/2010&EndDate=10/7/2010&UserID=1121&UserID=1074&UserID=1106
Expression: ="balbla...rs:Command=Render&StartDate=" & First(Fields!ThirtyOneDaysAgo.Value, "GetDates") & "&EndDate=" & Today & "&UserID=" & cstr(join(Parameters!UserID.Value, "%2c"))
Renders: rs:Command=Render&StartDate=9/6/2010&EndDate=10/7/2010&UserID=1121%2c1074%2c1106
IE Error: The value provided for the report parameter 'UserID' is not valid for its type. (rsReportParameterTypeMismatch)
Expression: ="balbla...rs:Command=Render&StartDate=" & First(Fields!ThirtyOneDaysAgo.Value, "GetDates") & "&EndDate=" & Today & "&UserID=" & cstr(join(Parameters!UserID.Value, ","))
Renders: &rs:Command=Render&StartDate=9/6/2010&EndDate=10/7/2010&UserID=1121,1074,1106
IE Error: The value provided for the report parameter 'UserID' is not valid for its type. (rsReportParameterTypeMismatch)
View 3 Replies
Nov 11, 2010
I am new to sql so please bear with me here.I have two tables, COURSES and RESPONSES which have a common field userID. I am making a grid view which displays each users available courseName from the COURSES table and dateTaken from the RESPONSE table. So I simply wrote the query as:
SELECT c.*, r.*
FROM COURSES c, RESPONSE r
WHERE c.userID = @userID1 and r.userID = @userID1 and r.userResponse = NULL
[code]...
View 2 Replies
Mar 31, 2010
How do you efficiently store and fetch data properties that is stored in an Array?
Public Function Customers() As IList
Dim cust = _dataNorthwind.Customers
Dim latt As New ArrayList()
For Each vlist In cust
latt.Add(vlist.CustomerId) 'how to store multiple properties here then fetch those?
[:(]
Next
Return latt.ToArray
End Function
View 5 Replies
Feb 23, 2010
I have set in one condition
Response.Cookies["mycookie"]["value1"] = string1;
Response.Cookies["mycookie"]["value2"] = string2;
c# code for reading these values to two string variables, str1 and str2.
View 2 Replies
Jun 3, 2010
I have two ListBox in my ascx file, I fill them with some data (no problem here), I make them multiple and increase the size, below is my code.
[Code]....
I use some jQuery code to exchange element between them (Here too, no problem). My problem begin when I post my form, I'm unable to get the data from the DropDownList with attribute multiple or size. I tried in my controler to add a FormCollection parameter, I can see every element in my form except those select tag with more options than id and name. I tested to put a manual select tag in my code with only an id and a name then add size and multiple attribute, when there is only id and name I can get the value but when there are more I can't get my select tag in the FormCollection
Also I need to get all the value in the ListBoxand not only the ones who were selected. I have been searching answer for 2 fays now... Without success, I only find resource on how to show ListBoxbut not how to get values from them in mvc web site and I don't find any resources who talk about multiple selection ListBox, I think I'm a bad searcher but....
View 3 Replies
Oct 12, 2010
This code works just fine for me to select * from x,y,z. However what I want to do is retrieve the values return and assign them to variables. How do I go about this?
[Code]....
View 1 Replies
Jan 9, 2011
consider this scenario: a user on my website has a profileID. There are some pluginID's associated with this profileID.
E.g.: User1 might have 2, 3 and 5 plugins associated with his profile.
When the user logs in, I store the profileID of the user in a session variable cod. ON a certain page, the user tries to edit the plugins associated with his profile. So, on that page, I have to retrieve those pluginID's from the DB.
I have applied this code but this fetches only the maximum pluginID from the DB and not all the pluginID's.
[Code]....
I was trying to figure out how can I store multiple pluginID's in this session variable?
View 2 Replies
Jan 6, 2011
I am trying to redirect to a page and send two values.
Now the second value is the value of a text box and If I type something one character or anything without space character then the redirect works but If I type two strings for second value or anything with a space then the redirected page hangs and shows a blank page. I am using-
Response.Redirect("Changes.aspx?id="+CustomerId+"&Req="+txtRequest.Text);
If I use value id= anything applicable and Req="A" then it works
but If I use value id= anything applicable and Req="A(space)B" then the next page hangs with a blank page.
View 9 Replies
Mar 3, 2011
I have jquery using ajax/json to grab an elements ID and then hits:
[System.Web.Services.WebMethod]
public static string EditPage(string nodeID)
{
DataTable dt = new DataTable();
using (SqlConnection con = new SqlConnection(Global.conString))
using (SqlCommand cmd = new SqlCommand("contentPageGetDetail", con))
{
cmd.Parameters.Add("@ID", SqlDbType.UniqueIdentifier).Value = Global.SafeSqlLiteral(nodeID, 1);
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
using (SqlDataAdapter da = new SqlDataAdapter(cmd))
{
da.Fill(dt);
}
}
if (dt.Count > 0)
{
string pageTitle = dt.Rows[0]["Title"].toString();
string contentID = dt.Rows[0]["ContentID"].toString();
return pageTitle, contentID, nodeID;
}
else
{
return "Failed";
}
}
When it's time to return I want to grab all content returned from the stored procedure back to the jquery method in the success section and set a hiddenfield, dropdown value, and a title in a textfield. In the jQuery I tried using "pageTitle" but it came up undefined. What do I need to do jQuery side to grab whats being returned and populate fields in my Web Form before showing the form?
View 3 Replies
Feb 2, 2011
I am able to transer the single value to another page(Pop_up) using following code i wanted to pass one more value to another page how can i add to following code.
status.aspx
<script type="text/javascript">
function OpenPopupLLP() {
window.open("LLparts.aspx?strWorkOrderNumber=" + document.getElementById("txtWON").value,"List", "scrollbars=,resizable=no,width=800,height=550");
return false;
}
LLparts.aspx
<script language="javascript" type="text/javascript">function GetRowValue(){
var val = window.opener.document.getElementById("txtWON").value;
document.getElementById("lbl1").innerText = val;
document.getElementById("txtWCON").innerText = val;
}
<body bgcolor="#ffcc66" onload="GetRowValue()">
form_load
txtWCON.Text = Request.QueryString("strWorkOrderNumber")
View 2 Replies
Sep 14, 2010
i have this code for redirecting one value Response.Redirect("contact.aspx?Pat=" + row.Cells(0).Text.Trim()
i try doing this Response.Redirect("contact.aspx?Pat=" + row.Cells(0).Text.Trim() & "contact.aspx?Nam=" + row.Cells(1).Text.Trim()) but on my landing page it concatenates the 2
this is my landing page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
PatID.Text = Convert.ToString(Request.QueryString("Pat"))
Patname.Text = Convert.ToString(Request.QueryString("Nam"))
so basically it puts everything in my PatID parameter
View 3 Replies
Feb 6, 2010
I am creating an online employment application, and instead of creating a table with 20 columns for job duties that may or may not receive values, I simply want to create 3 columns
ApplicantID
EmployerName (Name of Work history Employer)
JobDuty
I want to create a form on a page with 10 textboxes so the applicant can type in some job duties they had at that job.
Is there a way in C# or SQL to then cycle through and insert the textbox values as separate rows?
View 4 Replies
Oct 10, 2010
I have a asp.net page where i had placed two user controls.When the asp.net page loads naturally the first user control loads and then then the second user control loads.There is a value in the page load event of the first user control.I need to get this value in the second user controls page load event.
View 3 Replies
Feb 24, 2011
I wanted to select multiple items in listbox, but inside my listbox they are all values hence causing me unable to select multiple items. Is there any way i can select multiple values in listbox?
View 12 Replies
Aug 13, 2010
I have some logic that loops and adds a new Panel control to another control:
for (int segmentIndex = 0; segmentIndex < segments.Length; ++segmentIndex)
{
holder.Controls.Add(new Panel() { Width = Unit.Percentage(segments[segmentIndex] / segmentsSum * 100), CssClass = String.Format("segment segment-{0}", segmentIndex) });
}
container.Controls.Add(holder);
This works great, but there are a few values that I need to store on each panel within the loop. I need to be able to access these values in both c# and javascript, once the control is rendered on the page. What would be the best way to achieve this? I've used the Tag property before on some controls, but a Panel doesn't have one.
View 2 Replies
Apr 18, 2013
Currently i have my buttons labelled and positioned as follow :
x0_y3 | x1_y3 | x2_y3 | x3_y3
x0_y2 | x1_y2 | x2_y2 | x3_y2
x0_y1 | x1_y1 | x2_y1 | x3_y1
x0_y0 | x1_y0 | x2_y0 | x3_y0
What I'm trying to do is fill the buttons name programatically. So far I will get X and Y values and i need to change the text of that button at that position.
I know it's possible to do x0_y3.text = xxxx for each position but this will take years, i'm looking for a solution using a loop or some other technique to easily replace the text values. and the buttons are under an updatepanel.
ex :
GIVEN : xx=2 yy=2
ex. WHERE IT IS "x" & xx and "y" & yy
REPLACE TEXT WITH "hello"
I tried something like this, but it doesn't work with the updatepanel for some reason, but it works fine if i use a simple panel
Code:
For Each c As Button In UpdatePanel1.Controls.OfType(Of Button)()
MsgBox(c.ID)
c.BackColor = Drawing.Color.Yellow
Next
View 2 Replies
Mar 26, 2013
how to pass more than one value in query string??
Response.Redirect("wardno180.aspx?ab=" + TextBox3.Text);
i want to pass the value of one more text box in this query string
what changes should i make??
View 1 Replies