I am using Resource File COncept for Multilingual website
Now I have the popup windows for the parent window
In Parent window In Page_Load I am storing selected culture in session("culture")=SelectedCulture
In the Page Load of Child WIndow I m trapping this session value & set that culture for the child window
Now the problem as I click on button to open Child WIndow
1. The child window gets opened first then the pageof parent window called
2. The Child windows page_load is not called that's why the culture is not set for the child window
The page_Load of parent Window
I am using a datalist control and I added a datagrid as an item in it, the problem is that when I click in the template column of the datagrid it doesnt raise an itemcommand event....is there a way to pass the datagrid event outside the datalist??? I am using VB.Net
thnx in advance
The DataList control only bubble up the Click event of the button controls like Button, ImageButton, LinkButton placed inside the DataList control. So it does not do that for the ItemCommand event of the child datagrid control. In this case, you'll have two options IMO:
+ You only provide the event handler for the ItemCommand event of the child DataGrid control only.
+ You have to customise the DataListItem class, and override the OnBubbleEvent method so that it can bubble up the ItemCommand event from the DataGrid control to the ItemCommand event of the parent datalist control.
In an ASP.NET application written in VB.NET, there are many ways that you can use to create an event handler for a specified event of the server control:
+ Use the Handles keyword.
+ Use the AddHandler keyword.
+ Declaratively add in the control using OnItemCommand="YourEventHandler", then define the event handler in code-behind.
In your case, since you need to add the event handler for the child datagrid control, you can follow the last two options. For the second option, you first create event handler for the ItemCreated event of the DataList control. In this method, you get reference to the child datagrid control using the FindControl method, then you can add the event handler for the ItemCommand event of the datagrid using the AddHandler keyword.
For more information, you can see Server Event Handling in Web Forms Pages[^]
(sorry for my english)
It would be very very useful to me, and easier than any other way to do it, if I could, just by sending a http request, call a function in a webpart. The request can call either an asp page which will call the webpart, or the sharepoint app directly. I can create a specific webpart just for the function, it's no problem.
You can create an XMl file
with Section Name Required
Then this section can as many as key value pair as your controls to be validated
key name="Name" Value="Name Required" />
key name="Pwd" Value="Password Required" />
Now in code behind read this & display this massage according to the matched Key name with control name
You can put the error messages in an external resource file, then you can dynamically configure the messages without requiring the application to be changed. The documentation below can get you started: Creating and Retrieving Resources[^]
To apply the error massages to the validators, there are a couple of options here that you might consider:
+ In the code-behind, you can dynamically load the error messages, then assign it to the ErrorMessage or Text properties of the validators.
+ You can create create your own custom validators, and in this custom controls you simply provide a snippet of code to implicitly get the error messages from the resource files. Doing so, you can hide it from the page developer.
+ You can develop a custom class, say ErrorMessageProvider, this class can access all the validators in the page using the Page.Validators collection, and check the type of each validator and dynamically assign the appropriate message to the validator.
I am using Localization concept for multiLingual Support
SO How I should adjust size the web controls like labels , buttons etc on the web page So that if the Caption of these web controls changes according to the local The Size of that control should be enough to hold that particular text
Means I want to adjust the size of controls dynamically according to the text to displayed on that control whcih is according to the locale selected by users.
I am using localization concept in asp.net 1.1
I have resource files for each language (Like English, Chinese etc)
Now I have enter the value for the web controls displayed on the web page in the corresponding Resource File
Now How I should enter the value for each item of the dropdownList or Each Item of CheckBoxList/RadioButtonList in the resource file ??
as each item of these control does not have the separate Id.??
You can simply read the name of the project file: .csproj for the C# project, .vbproj for the VB.NET project. The name of this file is the name of the project. However, I'm still curious why you need this name.
the reason i need it is i m using customvalidators.now the function to be called by it is a script.this script is in turn calling a function i have kept in my class.now in the script i m not able to instantiate a class directly.it does not recognize the class unless i do ..now whenever i make a new solution and my page to it i need to change the project name in the script.this is the reason i needed it.if u find any other better to solve the problem do let me know.
I'm not sure about what you are doing, however there might be a work around solution. By default, the name of the output assembly of a project is the same as the project name unless you change it with another name in the project configurarions, so you might consider providing a snippet of code to the get the name of the assembly as an alternative for the project name.
There are two options that you can use the make the link/button invisible:
+ Provide a data binding exprssion for the Visible property of the column. The expression basically checks on the Approved column data and returns the bool value. For more information, you can see Data Binding Expression Syntax[^]
+ Create an event handler for the ItemDataBound event, in the event you can get reference to the button using the FindControl method, and do a checking on the Approved data to decide if you should make the control visible or invisible.
i have a page that enables site user to download report files from the server.
report file types are .pdf, .doc, .ppt and .xls
for that what i am doing is creating a Stream from file and convert it into the byte and binary write the output...
so it is working fine in IE but while using netscape, the download dialog concat the file name with .aspx ( fileName.pdf.aspx ), so netscape can not open the file with proper application..
any solution please help me, thanks in advance
here i m giving my code for depth review the problem