SQL Server :: Turning 2 Lists, Into 1?
Apr 1, 2011
I'm sort of new to ASP.NET. What i've done here is create a list of Newsletters seperated by University newsletters, and Alpha Newsletters. What I have now been asked to do is make these 2 lists into 1 list. I can't figure a Way to do it without designing the database? Does anyone have any ideas? Take these 2 lists and make 1? Using odsNewsletterAlpha and odsNewsletterUni to create 1 list?
<h2>University Newsletters</h2>
<asp:ListView class="lvUniversity" EnableViewState="true" ItemPlaceholderID="plcItem" DataSourceID="odsNewsletterUni"[code]...
View 3 Replies
Similar Messages:
Jul 22, 2010
SELECT MenuItemID, MenuItemType, ItemName, PizzaToppings, Description, GraphicFileName FROM MenuItems
WHERE (MenuItemType = @MenuItemType) AND (ItemName = CASE WHEN @ItemName = - 1 THEN ItemName ELSE @ItemName END)I have created 2 drop-down box and a search button to display all records when one drop-down box is set to 'All"In the web-form I have set one of the drop-down box to value = -1 and appenddatabounditems to true.In the SQL I have typed the above but it does not work? Any one have an idea how this could be achieved with SQL?Essentially retrieving all records with the 'all' value selected.
View 1 Replies
Aug 1, 2010
I am trying to get the drop down list to only include table1 entries where table3.int1 is the current selection in another drop down list (table2.id). Example:
Table1: id, string1, int
Table2: id, string1, string2, dec
Table3: id, int1 (ref table2.id), int2 (ref table1.id)
Both drop down lists are inside of a FormView object for a asp.net page. My current select command(s) are having the DropDownList for Table1 display all Table3 entries, instead of just the ones Tied to Table2 id from the other DropDownList.
View 8 Replies
Mar 8, 2010
I think I know the answer to this, just want to make sure.
Question: there's no way to turn off a timer in ASP.NET on the client side (easily—I've seen the undocumented hacks on the net). Therefore, you have to set up you own logic client side while the timer is running server side, correct?
I went through these examples and understand them:
http://www.asp.net/AJAX/Documentation/Live/tutorials/IntroToTimerControl.aspx
http://www.asp.net/AJAX/Documentation/Live/tutorials/TimerControlWithUpdatePanelsTutorial.aspx
So, the pseudocode for a trigger done programically—so you do something when somebody clicks a button Button1 would be-- after you set up a ScriptManager, UpdatePanel and suitable ASync PostBack triggers in XAML (as per the above links) so that the Ticks event is triggered in the UpdatePanel:
public partial class MyWebForm : System.Web.UI.Page
{
bool myTriggeringBoolean; //used to turn off and on code in the Timer's Tick event [code]....
View 6 Replies
Aug 17, 2010
I'd like to be able to turn rows of an html table into links to controllers.I figured something like
<td onclick="<%:Html.ActionLink("", "Index", new {id=item.user_id}) %>">
I'm using MVC 2
View 1 Replies
Jan 18, 2010
I have bunch of HTML code I am using to make rounded edge boxes on my controls. Is there a way to take this code and turn it into some kind of control or something so I do not have to keep pasting 10 lines of HTML code around everything I do?
<div id="BottomBody">
<div class="box1024" >
<div class="content1024">[code]....
One additional thing to note, the number HTML tags used inside the inner most DIV will change depending on where I use it in my site. So in some cases I will only have 1 tag and 1 tag but in other cases I could have 1 tag, 1 tag, 3 tags, and a HTML table. How can I make that work?
View 3 Replies
Mar 18, 2011
Is there a way I can handle HttpRequestValidationException without turning off ValidateInput?
What I really want is all HTML posted from a form to be automatically encoded in the model unless a particular property has the AllowHtml attribute set.
If I have to turn off ValidateInput, then what happens to the rest of my model validation? Will it still be validated or do I need to explicitally check ModelState.IsValid?
I'm also catching the exception in a custom model binder class but every time I try to access the offending property from Request.Form, the exception gets thrown. Is there a way to get that value in the model binder?
View 2 Replies
Dec 20, 2010
I created a little web service to minify JavaScript, and everything was nice, with all my tests passing. Then I noticed a bug: if I tried to minify alert('<script>');, it would throw a HttpRequestValidationException.
So that's easy enough to fix. I'll just add [AllowHtml] to my controller. But what would be a good way to unit test that this doesn't happen in the future?
The following was my first thought:
[TestMethod]
public void Minify_DoesntChokeOnHtml()
{
try
{
using (var controller = ServiceLocator.Current.GetInstance<MinifyController>())
{
return controller.Minify("alert('<script></script>');");
}
}
catch (HttpRequestValidationException)
{
Assert.Fail("Request validation prevented HTML from existing inside the JavaScript.");
}
}
However, this doesn't work since I am just getting a controller instance and running methods on it, instead of firing up the whole ASP.NET pipeline.
What would be a good unit test for this? Maybe reflector on the controller method to see if the [AllowHtml] attribute is present? That seems very structural, and unlikely to survive a refactoring; something functional might make more sense.
View 1 Replies
Jan 13, 2010
One thing I really love about web browsers, is the autocomplete feature they have for different controls, like textboxes in forms. However, some times users get confused with the dropdown appearing. So, we would like to be able to disable the autocomplete feature for some textboxes on some of our ASP.NET WebForms pages. Isn't there a property which controls that? Or is that done through JavaScript?
View 3 Replies
May 12, 2010
I have an application where I don't want the browser to be able to remember passwords. I can see the AutoCompleteType = disable and that seems to work in IE, but I also need to support FireFox. Setting autocomplete="off" doesn't seem to do anything. Is there anyway for me to kill the autocomplete of a password text box in FireFox?
View 4 Replies
Mar 8, 2010
I'm wondering if it's possible to be able to use an HTML editor (such as TinyMCE) in an ASP.NET form without turning off validation for the entire page. There are other fields in the page that I want to use validation for. Will those not get validated with validation controls if you set ValidateRequest="false" in the page directive?
View 4 Replies
Sep 24, 2010
I ran into a strange issue with the AJAX MaskedEditExtender control, the extender is used with the Mask="99/99/9999" and MaskType="Date". Initially when the page loads the textbox was set to readonly using textbox.Attributes.Add("readonly", "readonly") in the codebehind. After the page loads if the user clicks on a certain button it would change the textbox to editable using javascript code: textbox.readOnly = false. The strange thing is after that if you start typing in the textbox you can see the entire mask
(__/__/____) shifting to the right as you type. For example it looks something like this: 09__/__/____ instead of the normal 09/__/____.
If the textbox was never set to readonly in the first place this behavior won't happen. So it seems something got messed up when changing from readonly to not. I was able to reproduce this in a barebone aspx page with just the textbox, the mask extender, and a button that when clicked turning off the textbox's readonly. Anyone knows how I can fix this?
I'm using Ajax toolkit v3.0.30512
View 5 Replies
Feb 11, 2010
Here is a conceptual questions that I was going over the last few days. I have a simple application that I want to turn into a hosted solution.
My take on it is that in a sense each record in the database would have its own ID representing the hosted instance of the application, rather
than installing the application each time a new one is needed. Then I can easily differentiate between the instances, however I don't want to
store the instance ID in a session (bad for URL back links etc.) and don't really want to add it as part of the URL.
What would you suggest ?
Another part of the question would be how to pragmatically create a sub-domain representing the application instance, however that's a
Whole different question J
View 2 Replies
Jan 8, 2010
I have a listview whit "select" button.... i want when i click this button the listview should show a Delete buttonn What is wrong in my code ..i press select button there is noting hapning??
[Code]....
View 4 Replies
May 20, 2010
As always with .net, there are many ways of achieving the same thing, so what is the easiest way of achieving the following?
<repeater>
<itemtemplate>
<DDL_control OnItemIndexChange="">
</itemtemplate>
</repeater>
In the repeater, there are a number of dropdownlist controls. Each one is hooked up to an event which triggers when changed. When one instance is changed I would like to disable all other instances of the DDL control.
View 1 Replies
Sep 14, 2010
I have a problem with Opacity in my project - it turns the screen a solid colour instead of see-thru.
I am displaying a rotating wheel in a panel and using modalpopupextender.
1) Only happens in IE8
2) Only happens when there is a lot of data displayed on screen (i.e Datagrid displaying a lot of records).
[code]....
Example of my issue:
I have a screen with a Tab Control with 3 tabs.
Tab 2 and 3 contain a small amount of data on the grid (10 to 20 records), Tab 1 contains 1000+ records.
All this is within an Update Panel - the tabcontrol have AutoPostback set to on.
Now if I click tab 2 -> tab 3 -> tab 2 -> tab 3 etc then the progress show correctly with an opaque screen.
If I click Tab 1 the pop displays but the screen is a solid colour. If I try Tab 2 or 3 again the screen stays a solid colour.
View 8 Replies
Aug 8, 2010
I have a listview showing the data, and that i will use to Show, Edit, Delete, and Insert data.
I added a ASP.NET Ajax HTML Editor to the EditItem Template.
I click on EDIT button and it turns into the EditItem Template, i modify the data and when i click UPDATE it does nothing.
Neither updating data or turning back to ItemTemplate.
Here is its code:
[Code]....
And the Code behind:
[Code]....
View 2 Replies
Dec 13, 2010
I have tried everything for weeks with this now but can't get it to work. What I'm trying to do is to store an array in a session and add numbers when a user guesses. I also have to know how to loop through the array.
Please help
[Code]....
View 1 Replies
Jul 21, 2010
I have an self-referencing entity which maintains a list of like entities that are it's children. What I need to do is build a dropdown that lists all possible parents so when I add or edit a new entity of that type, I can select it's parent (or no parent). The problem lies in the sql. I simply don't know how to word it.
IList<ParentForumModel> parentForums = new List<ParentForumsModel>();
foreach (Forum forum in forumRepository.GetAll())
{
// not sure how to handle this here because it isn't in the correct order. I need them to be grouped by parent and sorted by the sequence field. It also needs to be a flat dataset, not something uses IGroupedQueryable or some such.
}
ForumAddModel model = new ForumAddModel
{
ParentForums = parentForums,
// other properties
}
public IQueryable<Forum> GetAll()
{
return context.Forums.??? // what Linq do I need here?
}
If this simply isn't possible with Linq2Sql, then is there a system where it is possible? Please don't say hnibernate.
View 9 Replies
Dec 29, 2010
I'm not sure on the best way to go about this one. Simply LINQ queries are easy enough for me, but I am looking for the most efficient way here.
I have 2 tables, Sliders and SliderItems. SliderItems have a FK that points to the Sliders Id.
I have been getting information on a particular slider like this:
public static List<Slider> GetSlider(Slider sItem)
{
DBContext db = new DBContext();
if (sItem.Id != Guid.Empty)
{
var list = from tbl in db.Sliders
where tbl.Id == sItem.Id
orderby tbl.Id
select tbl;
return list.ToList();
}
}
So what I need to do for my home page is pull back a set of data that I want to stuff into a data list. Thereby combining the Slider + SliderItems that go along with it.
Do I just do a normal LINQ query with a JOIN statement and toss them into a generic list that goes back to my DataList?
View 3 Replies
May 3, 2010
I have to put data into a dictinary, thus formed: Dictionary (Of Integer, List (Of RicercaNews))
but when I go to put the list in the dictionary, I always return the same record, as if it does not increase the index of the list.
This is the code:
ResultTable Dim As New DataTable ()
Dictgestionalews Dim As New Dictionary (Of Integer, List (Of RicercaNews))
Listacat Dim As New Dictionary (Of Integer, String)
Dim listaricerca As List (Of RicercaNews)
[Code]....
View 2 Replies
Sep 30, 2010
i have two dropdown lists and i would like if i select lets say "1" the second list returns "A""B" but instead it returns "A" how to make the second list display A"B when i select "1" from the first list.
View 12 Replies
Sep 27, 2010
I've been trying to get this to work for weeks. I am trying to use a cascading drop down to populate drop down lists. The service method is working as i'm able to view the data in the browser but when i run the application the drop down list is empty. see below for the service method.
[Code]....
The code for the drop down list:
Location Name:<asp:DropDownList ID="DropDownList3" runat="server">
</asp:DropDownList>
<asp:CascadingDropDown ID="CascadingDropDown1" runat="server"
Category="Locations"
TargetControlID="Dropdownlist3"
PromptText="[Select Location]"
ServicePath="~/LocationWebService.asmx"
ServiceMethod="GetLocation"
EmptyText="Nothing">
</asp:CascadingDropDown>
View 4 Replies
Feb 28, 2011
I am populating 4 drop down lists. The dropdownlists within the For loop work fine and I will ignore these for the rest of this post. Reading the code below should add 2 values to the dropdownlist ddlPost and should add 2 values to the dropdownlist ddlTailLength. Both values should be A and B. Both of these drop lists should show 2 values (A and B), but are showing 4 values each (A, B, A, B). The only loop on these pages is the one displayed below.
c#:
[Code]....
HTML:
[Code]....
View 3 Replies
Oct 20, 2010
I have a dropdownlist and a gridview with a drop down list in every row. I have removed other cols in Grid for simplicity.
Whenever a new value in the dropdownlist is selected I would like to set all of the dropdownlists in the gridview to that same value via javascript. (Yea both the dropdownlist outside the gird and the ones inside the grid are populated by the same data source)
The dropdownlist:
<asp:DropDownList onchange="javascript:onJDSelection();" ID="DropDownList3" runat="server"
DataSourceID="SqlDataSource4" DataTextField="circt_cstdn_nm"
DataValueField="circt_cstdn_user_id">
</asp:DropDownList>
The GridView:
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" onrowdatabound="GridView2_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Change to Job Designer" SortExpression="circt_Cstdn_nm">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("circt_Cstdn_nm") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:DropDownList ID="ddl_jd" runat="server" DataSourceID="SqlDataSource4" DataTextField="CIRCT_CSTDN_NM"
DataValueField="CIRCT_CSTDN_user_id"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
My current attempt:
function onJDSelection() {
var jd = document.getElementById('ctl00_MAIN_DropDownList3').Text;
var grid = document.getElementById('ctl00_MAIN_GridView2');
for (var i = 1; i < grid.rows.length; i++) {
grid.rows[i].cells[0].getElementsByTagName("*")[1].selectedText = jd;
}
}
[Code]...
When clicking on the dropdown I get an alert that says "test" and an alert that says "[Object object]" However nothing happens with the dropdowns in the grid and the alert(i) never fires.
View 2 Replies