How do you pass a linq query of the general form - var q = from c in Customers and assign the q variable to either the Model property or stuff it into the ViewData["myq"] variable? Any ideas ???
Programming is a state of mind
View Complete Post
I'm looking to have a search page where a user will select an item from a listview, then then taken to another page that wil display data based on their original selection.
A user will type in a string and be presented with a list of usernames that are like that string, when they select a user name who's profile they would like to view I would like the page that they're taken to, to be that users profile.
How would I transfer the variable from the search page to the profile page, and when I work on the profile page, how can I access that variable?
I need to provide some alternate content for my non-Flash users.
I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.
How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code. But this seems inelegant.
Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?
How to take
value of bound field of grid in a variable or in a textbox.
I m using
this code in .aspx page for grid.
<RowStyle CssClass="odd" />
DataField="DOC_TYPE_PK" Visible="true" >
<asp:TemplateField HeaderText="DOC TYPE ID" Visible="true"> &nbs
I am a longtime .NET developer but for big applications and services. This is my first asp.net project and I have chosen MVC. I have a need for nesting a ListView within a ListView. In this simple catalog app, I have EF 4 Entities that are Categories, SubCategories, ItemTypes, and Items.
My goal is to display a 5 column layout of SubCategories with their ItemTypes below them in a ViewPage. I did just fine with it done out in C# as server directives such as:
var subcats = Model.SubCategory.ToArray();
var nrSubCats = subcats.Count();
var rows = (nrSubCats/5) + (((nrSubCats % 5) > 0) ? 1 : 0);
for (var row = 0; row < rows; row++)
<div style="width: 100%; float: left; clear: right;">
var start = row * 5;
for (var i = start; (i < start + 5) && (i < nrSubCats); i++)
var subcat = subcats[i];
<div style="float: left; clear: right; width: 20%; margin-left: 5;">
foreach (var its in subcat.ItemType)
I know I have a valid solution, but the js is telling me that the value in the hdnRecordSaved variable has no value!Even when I specify in my function the following, it still tells me it has no value:var myTextField = document.getElementById('hdnRecordSaved'); alert(myTextField);
When I put the full value of the variable in (ctl00_ctl00_cphTopCenter_cphCenter_hdnRecordSaved.value), I get the correct contents back ("1"), which I set in my code behind. However, I would prefer to just put the short name in since the masterpages may change, etc. Unfortunately, I know I can get around this with VS2010, but we are using VS2008.
What am I doing wrong with the js naming conventions that can't give me the contents? Here is my below js.
<asp:Panel ID="pnlMapFields" runat="server" ScrollBars="Both" Height="430px">
<telerik:RadTreeView ID="RadTreeView1" runat="server" DataTextField="Description"
I have a page in my website where there is very little code-behind. I only have two lines of code in Page_Load() and the rest of the code is declarative ASP.NET code. I have a FormView control which uses a SqlDataSource to get some order information. The SqlDataSource calls a stored procedure called usp_GetOrderDetails, here's the code for the SqlDataSource:
<asp:SqlDataSource ID="sdsFormOrderDetails" runat="server" ConnectionString="<%$ ConnectionStrings:ForexDB %>" ProviderName="<%$ ConnectionStrings:ForexDB.ProviderName %>" SelectCommand="usp_GetOrderDetails" SelectCommandType="StoredProcedure" UpdateCommand="usp_UpdateOrder" UpdateCommandType="StoredProcedure" > <SelectParameters> <asp:ControlParameter Name="orderId" ControlID="grdOrders" PropertyName="SelectedDataKey.Value" /> </SelectParameters> <UpdateParameters> <asp:ControlParameter Name="orderId" ControlID="frmOrderDetails" PropertyName="SelectedValue" /> </UpdateParameters> </asp:SqlDataSource>
In this article Juval Lowy describes how exciting new features in Visual Studio 2005, that will improve your overall productivity compared to the first version of C#, so you can write cleaner code faster.
MSDN Magazine Visual Studio 2005 Guided Tour 2006
C# 2.0 introduces a wealth of exiting new features, such as generics, iterators, partial classes and anonymous methods. While generics are the most talked-about feature especially for former classic C++ developers, the rest of the new features are important additions to your .NET development arsenal, enhancing power and improving overall productivity. This article is dedicated to all the new C# 2.0 capabilities besides generics to give you a good overall picture of the upcoming features.
MSDN Magazine May 2004
I ran into an issud to day with the follwoing code. The strPanelOrder session variable is false, however, once it goes into the next if statement and sets the strTrimOrder to True, it changes the strPanelOrder session varialbe to true as well. Why is this and how to I stop that from happening?
If Session(strPanelOrder) Is "False" Then
If (strItemNumber.Length() = 10) And (strItemNumber.Substring(0, 2) = "FS" Or strItemNumber.Substring(0, 2) = "FC" Or strItemNumber.Substring(0, 2) = "DS" Or strItemNumber.Substring(0, 2) = "DC") Then
Session(strPanelOrder) = "True"
If Session(strTrimOrder) Is "False" Then
If (strItemNumber.Substring(4, 1) = "T") And (strItemNumber.Substring(0, 2) <> "AC") And (strItemNumber <> "Length") Then
Session(strTrimOrder) = "True"
Thanks in advance for taking a look at this.
why do i get
BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
with the code
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Run Access" />
Password change control won`t accept new password Hi guysI am developing a shopping cart with asp.net and sqlexpress. I am using aspnet authentication components to create a backend page. I designed the site to let in only authorized users in. Yesterday, I forget my password to login to backend and asked system recover my password. with recover password of the asp.net I was able to receive the temp password. I took that and logged in, of course asp.net forward me to password change component which I am having problem with. Every time I change my password , password change shows that I was successfull but after clicking on the continiue button password change component comes back. I went to properties of password change component and entered the main default page as destination but it is not helping. I close the IE clear the cache , even restart the machine. When I login always taking me to the password change page.So, I need your help with this. Please let me know your inputs.thanks
I am developing a shopping cart with asp.net and sqlexpress. I am using aspnet authentication components to create a backend page. I designed the site to let in only authorized users in.
Yesterday, I forget my password to login to backend and asked system recover my password. with recover password of the asp.net I was able to receive the temp password. I took that and logged in, of course asp.net forward me to password change component which I am having problem with.
Every time I change my password , password change shows that I was successfull but after clicking on the continiue button password change component comes back. I went to properties of password change component and entered the main default page as destination but it is not helping.
I close the IE clear the cache , even restart the machine. When I login always taking me to the password change page.
So, I need your help with this. Please let me know your inputs.
I want to store employee name,designation and department in session variable andretrieve in another page how to do this.
Hi everyone, I have what I think is a weird issue. I send text from one page to another via Session Variable. When page 2 loads, the text box has the session text set, but if the user changes the text and clicks the button, the SQL database is update with the original session text. If I remove the redirect from the page 2 button_Click method, then, the page refreshes with the textbox reverting to the session text and thr SQLDataSource has the session text added to it.
Why would the button click cause the textbox refresh with the text from the pageLoad before updating the data source?
Partial Class _1
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Session("UpdateProd") = "Have some text here to send to a textbox on page 2"
Partial Class _2
my requirement is textbox has to accept only numbers and " ( ) - " symbols only.
any code plz