I have this class that contains vars for db connection;
Public Shared s As String
Public Shared con As String = WebConfigurationManager.ConnectionStrings("foo").ToString()
Public Shared c As New SqlConnection(con)
Public Shared x As New SqlCommand(s, c)
I import this to my page like this;
Imports DBVars
I'm then able to access these vars from my page.
But if I try to import them into a user control the variables are not available. Am I making an error or is this expected?
Thanks.
I have the following (trimmed) markup:
<asp:Repeater ID="CostCategoryRepeater" runat="server">
<ItemTemplate>
<div class="costCategory">
<asp:Repeater ID="CostRepeater" runat="server" DataSource='<%# Eval("Costs")%>'>
<ItemTemplate>
<tr class="oddCostRows">
<td class="costItemTextRight"><span><%# Eval("Variance", "{0:c0}")%></span></td>
<td class="costItemTextRight"><input id="SupplementAmount" class="costEntryRight" type="text" value='<%# Bind("SupplementAmount")%>' runat="server" /></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</div>
</ItemTemplate>
</asp:Repeater>
The outer repeater's DataSource is set in the code-beside. I've snipped them, but there are Eval statements that wire up to the properties in the outer Repeater. Anyway, one of the fields in the inner Repeater needs to be a Bind instead of an Eval, as I want to get the values that the user types in. The SupplementAmount input element correctly receives it's value when the page loads, but on the other side, when I inspect the contents of the Costs List when the form posts back, the changes the user made aren't present. Thanks.
I’m not too familiar with webpage design and am having a problem. I have the following datalist which is displayed ok but it is the section near the bottom that I am having with. I want the Hyperlink image to be on the same line as the “Details” text. Unfortunately the text appears below the Hyperlink control. Is there an easy fix to get what I want ? Should I be using the “div” mark-up instead of and ?
<asp:DataList ID="dgDownloads" Width="100%" runat="server" EnableViewState="false" >
<ItemTemplate>
<tr>
<td>
<h3 class="mast3"><%# DataBinder.Eval (Container.DataItem, "Alias", "Reported by : {0}")%></h3>
</td>
<td>
<h3 class="mast3"><%# DataBinder.Eval(Container.DataItem, "CreationDate", "Reported on : {0:dd/MM/yyyy}")%></h3>
</td>
</tr>
<tr>
<td colspan="2">
<h3 class="mast6"><%# ((System.Data.IDataRecord) Container.DataItem)["Heading"] %></h3>
</td>
</tr>
<tr>
<td colspan="2">
<asp:HyperLink CssClass="buttonStyle" ImageUrl="../images/bg/download.png" runat="server" NavigateUrl='<%#((System.Data.IDataRecord) Container.DataItem)["FileURL"] %>' />
<%# ((System.Data.IDataRecord) Container.DataItem)["Details"] %><ln/><br/><br/>
</td>
</tr>
</ItemTemplate>
</asp:DataList>
Is there any book or links that I can read some tutorial about the WPF ribbon control. I need to get some basics . Also can any one recommend good book in WPF or a starter kit.
Thanks.
hi,
I am using a dropdown, a devexpress grid view and a button on my page.
My gropdown contains the months in the format MM/YYYY, and on dropdown's selection change the data binds in the grid view.
the functionality of button is to go on previous page as same as back button of browser.
Now, my prob is that if i select any month and then select another month, the data changes.
but now when i click on back button having onclick ="history.go(-1)", changes the data on the grid view but the month in the dropdown remains the same.
For example:
Suppose, first i have month selected as 02/2010
At this time the data in grid view is for exapmle 01234
now when i select month 03/2010
the data in grid changes to 56789
now when i click on back button, then data in grid changes to 01234 but the month in dropdown remains to 03/2010.
Please help me for this..
Thanks in advance for all who will give solution for this.
i have about 50 labels that are each just barely big enough to fit the letter x in them. the labels are on a report. i need to align all the labels very precisely.
is there an easier way to do this than trusting my eyes?
i am trying to use flowplayer to play .swf files
this is how i am trying:
$(function(){
flowplayer("player", "http://d2p65vgzoeytng.cloudfront.net/comun/0720/video/sol_gavilanes.swf ");
});
where
<a id="player" href="http://pseudo01.hddn.com/vod/demo.flowplayervod/flowplayer-700.flv" style="display:block;width:425px;height:300px;"></a>
Firebug won't log any errors; video is playing but without the player
Please check here http://jsfiddle.net/HAVtS/5/
what am i missing?
Hi,
I have an entity which looks something like this:
Id (PK)
Name
Other business properties and associations...
I have the need for my DAL (JPA with hibernate as provider) to return a list of the entities which correlate to some constraints (or just return them all) but instead of returning the entities themselves I'd like to receive only the Id and the Name properties.
I know this can be achieved with HQL/SQL (something like: select id,name from entity where...) but I don't want to go down that road.
I was thinking of somehow defining the pair a compositioned part of the entity and thought that might help me but I'm not sure that's "legal" as the Id is the PK.
The logic for this scenario is to have a textbox which asynchronously queries the web-service (and through it the DAL) for the relevant entities and once an entity is selected then it is loaded as a whole and shipped to the front-end.
Would appreciate any feedback,
Ittai
Hi
In a repeater control can we achive both sorting and grouping together, If possiple plz guide me the way.
If not, what is the best control to obtain just sorting and grouping.
Thank You
I'm wondering about the famous MSN chat clients conversation windows! I'm sure there must be alot of different aspects but I'd like to focus on those little sliding panes. For instance where the pictures of the people in the conversation is displayed. When you click the collapse button the pictures dissapear and the panel gracefully slides in, and when you click it again to expand, it slides out and the pictures are smoothly faded in. How would one go about customly drawing a control in WinForms that had simmilar behaviour?
Hi, I have 6 buttons on my GUI. The visibility of the buttons can be configured via checkboxes. Checking the checkbox and saving means the correpsonding button should be shown. I am wondering if it is somehow possible to have one TinyInt column in the database which represents the visibility of all 6 buttons.
I created an enum for the buttons, it looks like that:
public enum MyButtons
{
Button1 = 1,
Button2 = 2,
Button3 = 3,
Button4 = 4,
Button5 = 5,
Button6 = 6
}
Now I am wondering how to say that for example only button1, button5 and button6 are checked using this one column. Possible at all?
Thanks :-)
I am building a winforms application, i have two comboboxes which have the same datasource, the datasource is a DataTable. Now, when I select a value in one comboBox, the value of another comboBox is changed too. Is there a way make it change without affecting the other?
How can i get same functionality in windows forms as in the next example. When i have two links one beneath, and when i click first link a panel is visibleunder it and next link is shifted. When i click again the panel is invisible and second link shifted back.
<script type="text/javascript">
function toggleDivState(divName)
{
var ctl = window.document.getElementById(divName);
if (ctl.style.display == "none")
ctl.style.display = "";
else
ctl.style.display = "none";
}
</script>
<a href="javascript:toggleDivState('poll<%# Eval("ID") %>');">
<div style="display: none;" id="poll<%# Eval("ID") %>">
Okay i have a custom server control that has some autocomplete settings, i have this as follows and it works fine.
/// <summary>
/// Auto complete settings
/// </summary>
[System.ComponentModel.DesignerSerializationVisibility (System.ComponentModel.DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty),
Category("Data"), Description("Auto complete settings"), NotifyParentProperty(true)]
public AutoCompleteLookupSettings AutoComplete { private set; get; }
I also have a ParameterCollection that is really related to the auto complete settings, currently this collection resides off the control itself like so :
/// <summary>
/// Parameters for any data lookups
/// </summary>
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty)]
public ParameterCollection Parameters { get; set; }
What i would like to do is move the parameter collection inside of the AutoCompleteSettings as it really relates to my autocomplete, i have tried this but to no avail..
I would like to move from
<cc1:TextField ID="TextField1" runat='server'>
<AutoComplete MethodName="GetTest" TextField="Item1" TypeName ="AppFrameWork.Utils" />
<Parameters>
<asp:ControlParameter ControlID="txtTest" PropertyName="Text" Name="test" />
</Parameters>
</cc1:TextField>
To
<cc1:TextField ID="TextField1" runat='server'>
<AutoComplete MethodName="GetTest" TextField="Item1" TypeName ="AppFrameWork.Utils" >
<Parameters>
<asp:ControlParameter ControlID="txtTest" PropertyName="Text" Name="test" />
</Parameters>
</AutoComplete>
</cc1:TextField>
I have a weird problem with Google Maps Control.
I've tested in a blank page my custom maps with custom markers and everything seems to be ok, also with the control panel.
When I tried to import all my code in the page I'm working with ( I use a full screen fluid grid system ) the control panel is displayed with strange size.
I tried everything for disable/enable the ui of the Google Maps but the problem remain.
The code of my maps are exactly the same, both in my blank page and in my site, but in the site the ui control panel is displayed very strange.
Here's the code:
<div id="map_canvas2" style="height: 580px; width: 100%;"></div>
<script>
var image = 'path/to/your/image.png';
var mapOptions = {
zoom: 17,
center: new google.maps.LatLng(45.499290, 12.621510),
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false
}
var map = new google.maps.Map(document.getElementById('map_canvas2'), mapOptions);
var myPos = new google.maps.LatLng(45.499290,12.621510);
var myMarker = new google.maps.Marker({position: myPos, map: map, icon: 'http://www.factory42.it/jtaca/wordpress/wp-content/uploads/2014/06/pin-map.png' });
</script>
</div>
Here's an img:
http://www.factory42.it/jtaca/wordpress/wp-content/uploads/2014/06/img-maps.png
i have a textbox array using that i create 20 text boxes in runtime,
i need to get the focus if a particular text box(if i press downarrow
in keyboard how to get the key down of a particular text box it can be
3rd text box).
Consider the feature in Visual Studio 2010 for snippets in the HTML Source view of a web page.
type a control name in plaintext with no markup or brackets!
... e.g. hyperlink.
Then hit Tab
Your web control has been auto-completed for you. It's up to you to fill in the other details that you need.
This works for form as well:
<form action="default.aspx" method="post">
</form>
This looks like a real time saver. This is supported in WebForms and ASP.NET MVC projects.
What other snippets are available in Visual Studio 2010 in the Source view of a page?
Hi,
I have an address control which display the contact info of the person.
so it displays something like
1234, street
City, CA 12345
Now i want to give user flexibility to create format out of it.
For ex someone might want to display address as,
street, City, Country
OR
Just display their emails:
[email protected][email protected]
Any good ideas on how to it or similar examples?
thanks
Hi guys,
I have a View with a Master Page. The user control makes use of a Model:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BudgieMoneySite.Models.SiteUserLoginModel>" %>
This user control is shown on all screens (Part of the Master Page). If the user is logged in, it shows a certain text, and if the user isn't logged in, it offers a login box.
That is working OK.
Now, I am adding my first functional screen. So I created a new view... and, well, i generated the basic view code for me when I selected the controller method, and said 'Create View'.
My Controller has this code:
public ActionResult Transactions()
{
List<AccountTransactionDetails> trans = GetTransactions();
return View(trans);
}
private List<AccountTransactionDetails> GetTransactions()
{
List<AccountTransactionDto> trans = Services.TransactionServices.GetTransactions();
List<AccountTransactionDetails> reply = new List<AccountTransactionDetails>();
foreach(var t in trans)
{
AccountTransactionDetails a = new AccountTransactionDetails();
foreach (var line in a.Transactions)
{
AccountTransactionLine l = new AccountTransactionLine();
l.Amount = line.Amount;
l.SubCategory = line.SubCategory;
l.SubCategoryId = line.SubCategoryId;
a.Transactions.Add(l);
}
reply.Add(a);
}
return reply;
}
So, my view was generated with this:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Collections.Generic.List<BudgieMoneySite.Models.AccountTransactionDetails>>" %>
Found <%=Model.Count() % Transactions.
All I want to show for now is the number of records I will be displaying.
When I run it, I get an error:
"The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[BudgieMoneySite.Models.AccountTransactionDetails]', but this dictionary requires a model item of type 'BudgieMoneySite.Models.SiteUserLoginModel'."
It looks like the user control is being rendered first, and as the Model from the controller is my List<, it's breaking!
What am I doing wrong?
I have a form with a panel docked in it. I then dynamically create 15 panels (named: panel_n) and 15 pictureboxes (named: picturebox_n) on the primary panel (named ContainerPanel).
When dragging the any picturebox over a panel (panel_n) created using the relevant mouse events. I would like to get the panel's name that the picture box was dragged over. The mouse cursor seems to be captured.
I have tried creating a IMessageFilter interface, but there are still no events that trigger when dragging one of the pictureboxes over any one of the panels.
The ClientRectangle.IntersectsWith function also does not work as the co-ords are always 0,0.
All I need is the panel name where the picturebox was dragged over (preferably on the mouseup event)
I have 2 input textboxes that take a host or IP. When the user leaves an input box an event is fired that checks the input to see if it is actually a live computer. The results are then put into the appropriate label.
My question is, should I be using separate events for each input box, since they update different labels? Or, can I use 1 event and check who the caller was, then update the appropriate label?
How can i solve the following (simplified) problem?
M-V-VM context. I want to show text at the UI.
In case the user has the rights to change the text, i want to use a textbox to manipulate the text.
In case the user has no rights, i want to use a label to only show the text.
My main problem: how to exchange textbox and label and bind Text resp. Content to the same property in viewmodel.
Thanks for your answers
Toni