Internationalization - Hprovide Translations For Items In A Custom Web Control (.ascx)?

May 20, 2010

How do I go about providing localised text for items in a custom web control? I had thought that I just need to add meta.resourcekey tags to the control items and then define and fill some resource files called mycontrol.ascx.[lang].resx but that doesn't seem to work.e.g.

MyControl.ascx
<asp:Label ID="Label1" meta:resourcekey="Label1" runat="server" Text="Oops!"></asp:Label>
MyControl.ascx.de.resx
Label1.Text Donner und Blitzen!

View 2 Replies


Similar Messages:

Custom Server Controls :: Inherit The Logion Control UI In Ascx Login Control?

Mar 14, 2011

How can I inherit the logion control UI in my custom ascx login control as well override it's OnAuthenticate event in my cusotm control code.

View 2 Replies

Control Within Ascx Is Null When Ascx Is Added From Codebehind?

Apr 14, 2010

I am having difficulties how to construct my question, but if I have to put it simply the situation is that I have categories of products. I have an aspx with a repeater on the left that lists the categories. And I want the products to be listed on the right. Category number is variable so I made an ascx with a DataList in it. When I try to do foreach category, ascx = new ascx(); then the DataList within this ascx control is null.

ps: what I want to do is to preload all the products (thre is not much) and hide the divs and fadein fadeout them using jQuery when a category div is clicked.

rightnow it is using jQuery.load(); and I don't like how the images load, cuz they download from top to bottom. Progressive gifs alsdo not an option. site demo is here [URL]

View 1 Replies

User/server Control With Custom List Items / Create A Simple Menu User Control

Feb 18, 2011

I'm attempting to create a simple menu user control just as outlined here.

The attached code results in an "Object reference not set to an instance of an object" error, but I can't figure out why.

<%@ Master Language="VB" CodeFile="MySite.master.vb" Inherits="MySite" %>
<%@ Register src="Controls/Menu.ascx" tagname="Menu" tagprefix="my" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">......

View 1 Replies

Localization :: Difference Between Keywords Like Internationalization?

Apr 13, 2010

I was trying to figure out difference between keywords like Internationalization, Localization etc. and publish paper on best practice. But I got confused even on basic definitions which are so varying on internet. Following are 2 theories I found, so far. please advise which is correct?

Theory - 1

Globalization is a plan tom implement Internationalization and Localization

Internationalization - It is not implementing multiple languages, but it include activities so that Application can be made to support multi-languages and cultures in future. Like doing activities such as:

- Using nVarchar instead of varchar
- Avoiding Satic text and instead storing data to display in resource/text files

Localization - This is actual process when an internationalized application is updated with multiple languages and localization settings. For example, continuing with Internationalziation I would say activities like:

- Formatting Date, Numbers, Currency etc. using CurrentCulture class
- Adding text for different languages in files (we created during internationalization process) and customizing UI
- Using CurrentUICulture class for language conversions
- Providing user an interface to set their preferences
- Regional Settings in Administrative Panel of Windows is actually Localization

Theory - 2
Globalization - same as above Internationalization - First part of aforesaid Localization definition - Number. Currency etc. formatting (General Tab in Regional Settings)

Localization - Second part of aforesaid Localization definition - Language Translation (Language Tab in Regional Settings)

QUESTION: Which one is correct theory? If both above are wrong, what is right?

View 4 Replies

JQuery :: JQuery Validate Plugin To Add Rules To Validate ASCX Custom User Control?

Mar 6, 2011

I would like to know how to use jQuery's Validate plugin to add rules to validate controls in ASCX custom user control?

View 4 Replies

C# - Custom Attribute In A UserControl (ascx)?

Mar 8, 2011

Supposing I have a user control like this <MyTag:MyWidget runat="server" /> I am wondering if I can do something like <MyTag:MyWidget runat="server" MemberHeight="400" PublicHeight="200" /> So that in MyWidget.ascx I can have <div height="<%=IsLoggedIn ? MemberHeight : PublicHeight%>"> or something like that...? Because I want the height to vary in each page that is using this widget.

View 2 Replies

SQL Server :: Database Design / Create A Separate Table Which Will Contain The Translations For All 50 Tables?

Sep 28, 2010

I am working on a multi-lingual application Assume the following:

Database has 50 tables and application has to support 5 languages

Which is the best way to design the database:

1. Include a langugae column for each table. Repeat the values for each language. Say i have a country table which has 100 countries in it. Then my design will contain 500 rows (100 for each langugae)

2. Create a separate table which will contain the translations for all the 50 tables in with a foreign key to the parent table.

Which is more efficient out of the above two.

View 3 Replies

Databinding - Binding Custom Class Property From ASCX Markup?

May 19, 2010

I have an ASCX that inherits from a WebControl that has a 'CustomConfiguration' property of type CollectionConfigurationItem. This configuration gets set elsewhere in the code, so by the time it gets to the ASCX it is set up to how I wish to use the data. At this point I'd like to render out another control using this configuration, like so:

<modules:DataModule runat="server" CustomConfiguration="<%# Model.CategoryListConfiguration %>" />

However, breaking into DataModule always results in 'CustomConfiguration' being null, which is the default value for the property. I've tried adding a Bindable attribute to the property but to no avail, and when I set an EventHandler for the DataBinding event on the DataModule it doesn't even get called.

How can I set this custom-class-typed property from the markup or, failing that what's the second-best method of getting this to work?

View 1 Replies

Forms Data Controls :: How To Add JavaScript To Grid Custom Column In Ascx Page

Nov 11, 2010

I am getting required functionality when I am adding javascript to grid column in aspx page. but i am not getting the same functionality when l am loading ascx page in my aspx page.

View 6 Replies

C# - Show / Hide Using Javascript On A Control Inside A ASCX Control In A Gridview

Oct 8, 2010

I have written a web usercontrol (ascx). Inside, there is a Panel that I want to show/hide on click of a hyperlink inside the usercontrol.

Normally, this is easy just by doing something like this (the onclick attribute is added to the hyperlink on prerender):

var PanelToShow = document.getElementById('<%=PanelInvoiceHasBeenCreated.ClientID %>');
if (PanelToHide != null) {
PanelToHide.style.display = 'none';
}

but because the ascx control is held within the gridview, the above will assess all the controls (of which there are many in the gridview) with the name 'PanelInvoiceHasBeenCreated'. The only time it will work is when there is 1 row in the gridview. Currently, with my existing code, if I click the hyperlink in any row, it shows/hides the panel in the bottom row of the gridview!

Therefore, my question is how do I get the actual, unique ID I need to show/hide on the correct control in the correct row?

View 2 Replies

MVC :: How To Encapsulate Logic In Ascx Partial View With The Same Efficiency Of Webforms Ascx

Aug 10, 2010

I have to build a few ascx partial views in my MVC applications to encapsulate re-usable functionalities as well as archive SOR and SOC. However, I encountered challenge how to encapsulate the business logic that drives MVC ascx views.In webforms, the code behind of an ASCX control can handle a button click event and browser still shows the same page with only one postback. How can I archive the same thing in MVC? When ~/Address/Edit/2 includes an ascx partial view with a button on it that calls another MVC action - let's say ~/ShareController/CommonAction - what is the best way for the CmmonAction to return to the very same view that includes the ascx file?Perhaps I am missing a common pattern in MVC web development?

View 5 Replies

C# - Add Reference To Method In Custom Control To A Child Control Created In That Same Custom Control

Feb 3, 2010

I have a custom control that is based off the gridview control located at: here The control is basically a gridview that automatically creates a column of checkboxes that can be used to "check" individual rows in the gridview. During the gridview's "CreateColumns" event, the "checkboxcolumn" is created dynamically. The checkboxcolumn also contains another checkbox in the header that is used to "select/deselect all" checkboxes in the column. Since the gridview does not automatically remember the state of the checkboxes in the checkboxcolumn on postback, I added a method to the control called "SaveCheckBoxState" which stores the indexes of the checked rows in Viewstate, and then I modified the "OnRowDataBound" event to check the Viewstate and reset the checkboxes based on the Viewstate.

I then added a call to "SaveCheckBoxState" in the gridview's OnSorting and OnPageIndexChanging events. This works great so long as I'm sorting or changing pages. However, I need it to update the viewstate everytime someone clicks or unclicks one of the checkboxes. At this time, the checkboxes are rendered with an onclick event that calls some javascript to highlight the row, or in the case of the checkbox in the header, to select/deselect all checkboxes. I need to call the "SaveCheckBoxState" method from the javascript used by the customcontrol, or I need to find a way to modify viewstate from javascript and perform the same action as "SaveCheckBoxState".

I've tried adding the "SaveCheckBoxState" to the onclick event declaration in the checkboxes, but when run, it simply tells me that the method is undefined. It doesn't exist in the parent page, and I don't think I should have to make an event for the parent page to pass the click to. It seems to me this should be all self contained within the custom control. Does anyone know how I can acheive this? Here is the code for the gridview OnPreRender event where the onclick event of the checkbox is set:

protected override void OnPreRender(EventArgs e)
{
// Do as usual
base.OnPreRender(e);
// Adjust each data row
foreach (GridViewRow r in Rows)
{
// Get the appropriate style object for the row
TableItemStyle style = GetRowStyleFromState(r.RowState);
// Retrieve the reference to the checkbox
CheckBox cb = (CheckBox)r.FindControl(InputCheckBoxField.CheckBoxID);
// Build the ID of the checkbox in the header
string headerCheckBoxID = String.Format(CheckBoxColumHeaderID, ClientID);
// Add script code to enable selection
cb.Attributes["onclick"] = String.Format("ApplyStyle(this, '{0}', '{1}', '{2}')",
SelectedRowStyle.CssClass,
style.CssClass,
headerCheckBoxID);
// Update the style of the checkbox if checked
if (cb.Checked)
{
r.BackColor = SelectedRowStyle.BackColor;
r.ForeColor = SelectedRowStyle.ForeColor;
r.Font.Bold = SelectedRowStyle.Font.Bold;
}
else
{
r.BackColor = style.BackColor;
r.ForeColor = style.ForeColor;
r.Font.Bold = style.Font.Bold;
}
}
}

View 1 Replies

Custom Server Controls :: Custom Control's Constructor / User To Set That variable In The Properties Window After They Drag The Control Onto A Form?

Mar 4, 2010

I have a custom control which inherit from the Table class and in the constructor, it takes a an integer as an argument. There is no empty constructor.

Is there a way for the user to set that variable in the properties window after they drag the control onto a form.

I know some .NET controls, you can set the source for the parameter to different things like another control's property, QueryString using just the properties window.

Right now, I have to create the control dynamically. I read the query string and then created the object.

View 1 Replies

Custom Server Controls :: Paging And Sorting Gridview Custom Control Inside Of A Wizard Control?

Dec 24, 2010

here's a situation and I would appreciate your response.

I have programmatically created the Wizard control:

Page_Load(obj s, evargs e)
{
Wizard ClaimDetailWizard = new Wizard();
foreach(int item in selectedItems)
{
//create new step
//added custom control to new step
//add step to wizard
}
//added wizard to a placeholder on a page
}

Based on List I get from Session i added new steps to my wizard To each step I had added a custom control

Each custom control in tern contains another custom Gridview Control in it.

So here's the problem when the page loads for example for two steps. All is good Wizard does what it's supposed to do.

But when I try to use sorting or paging in that custom Gridview. Somehow it displays the gridview I should see in the next step of the wizard.

Also what I'm noticing through debugging. Is that when I press next in the wizard I go back to the original page where I do all of the code specified above, and it recreates the wizzard. But it goes to the next step. Is this the way wizard supposed to work? Just doesn't seem very efficient.

View 1 Replies

Custom Server Controls :: Add This Control To The Page,an Alert To Check The Text Value Of The Custom Control?

Dec 20, 2010

created a Custom Textbox Control that is intended to be a "masked date" textbox, so that I can handle different ways a user might enter in a date and make it work no matter what.I did this by creating a custom control with 3 separate Textboxes one for month,one for day one for year,then do some handling for different things that could be entered and it would all work.

The problem I am having is,when I add this control to the page,if I do an alert to check the Text value of the custom control it just gives me "[ServerControl1]" even if I enter in a date.

I tried doing an AutoPostback after entering so that it would refesh the Viewstate to have the values of the textboxes but the control doesnt seem to actually postback, even though I have it enabled.accessing the Textbox value after someoen
has entered a date?first custom control I have created and have been using google.

My Server Control Code is as follows:

[Code]...

View 1 Replies

Custom Server Controls :: Unable To Convert User Control To Custom Control

Oct 27, 2010

I have created a user control and am ready to convert it into a custom control. I am trying to follow:

[URL] the steps mentioned in the link.

I am not seeing Build / Publish Web Site option.

I am using VS 2008. I only see Publish User Control but it doesn't give all the settings mentioned below. When I do publish user control, it just copies the ascx file to the desired location. how can I convert the user control to custom control.

View 2 Replies

Custom Server Controls :: ".ascx" Is Not A Valid Virtual Path?

Jan 25, 2010

I am trying to create a templete for an outside vendor (who will be hosting that section) that is going to be doing a portion of our website. I need to give reference to our header and footer for the outside vendor to reference. I am getting the following error.Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.Parser Error Message: 'http://www..mywebsite.com/CorporateHeadLinks.ascx' is not a valid virtual path.Here is the line of code that is creating the error:<%@ Register Src="http://www.mywebsite.com/CorporateHeadLinks.ascx" TagName="HLinks" TagPrefix="HeadLinks" %>When I go to the url I get404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.The file does exist. I am assuming the 404 error has to do with the ascx page not having opening and closing html tags. The page is referenced in our locally hosted pages as follows and works fine.

<%@ Register Src="~/CorporateHeadLinks.ascx" TagName="HLinks" TagPrefix="HeadLinks" %>

Is there an IIS setting I am missing or does the reference need to be done differently? My webserver is Windows Server 2008.

View 4 Replies

C# - Set A Int Property Of A Control On ASCX?

Oct 15, 2010

I have an ASCX that contains

<my:Foo ID="Bar" runat="server" Value='' />

I want to set Value with textbox1.Text, but Value is an Int32. I am looking for something like this:

<my:Foo ID="Bar" runat="server" Value='<%= Int32.Parse(textbox1.Text) %>' />

But I getParser Error Message: Cannot create an object of type 'System.Int32' from its string representation '<%= Int32.Parse(textbox1.Text) %>' for the 'Value' property.Is there a way to do this on the ASCX file? Do I have to implement a TypeConverter for this property?

View 2 Replies

Accessing Property Value Of A Custom Control By Another Custom Control In Design-time

Oct 18, 2010

I created an Extender which has a custom property that drills down a list XML elements from an xml file, where users can select xml elements during design-time. This works perfectly fine. However, my code only has a hardcoded xml filename (source of the xml elements list) and I need to change this by maxing the xml file user-specified.

What I did is that I created another control (panel) which has a custom property that when clicked (through the ellipsis), it will allow a developer to select the xml file which is supposed to be the source xml file that the Extenders shall use. The filedialog from custom panel's property works perfectly fine.

However, my problem now is that when I drag-drop my Extender, I cannot find a way to get the property value of the custom Panel Control which contains the xml filename. I tried creating a static variable which I thought the custom controls can share but VS2010 is breaking.

View 4 Replies

How To Load Ascx Control In .net Mvc View

Jul 16, 2010

how can i load ascx control in asp.net mvc view ? i am using url.action in src but it is not working.

View 1 Replies

How To Register A Css Page From An Ascx Control

Sep 24, 2010

How can I register a css code block inside an ascx control?

Can I just have

<head id="head" runat="server">
<style type="text/css">
.customClass
{
background-color: Lime;
}
</style>
</head>

Anywhere in ascx page? I doesn't seem to work?

View 2 Replies

C# - DropDown To Filter Out ASCX Control?

Feb 5, 2011

I have a dropdown list on my form which should filter out or display my tag cloud for an entire project or for a specific iteration. At the moment, I don't get any errors, but the ASCX control doesn't seem to update.

<asp:DropDownList ID="filteroptions" runat="server" onselectedindexchanged="filteroptions_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
<asp:UpdatePanel ID="UpdateIteration" runat="server">
<ContentTemplate>

[Code]....

View 1 Replies

C# - SelectedIndexChanged To Filter Ascx Control?

Feb 5, 2011

I am using a databound dropdown list to populate a combobox with project iterations and an ascx control to display a tag cloud. I am retrieving the selectedValue of the dropdown and storing it as a session to filter out the tag cloud (for the entire project or by iteration).I am getting an error, because the default value which I have entered cannot be then converted to an integer.
[code]...

View 3 Replies

.net - Add Custom Object To DropDownList Items?

Jul 11, 2010

I'm using DropDownList within my WebApplication. I need to keep additional piece of information with each Item on list. How can I achieve this?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved