OpenFileDialog using - file-upload

I am using Ext.Net.I want to use OpenFileDiaolog filter in aspx.(in fileuploadfield tag)
Is it impossible ?
this is my aspx code:
<ext:FileUploadField ID="uploadAlani1" runat="server" Width="150" Icon="Attach" Text="Örnek Dosya" >
<DirectEvents>
<Change OnEvent="DosyaSec" IsUpload="true"></Change>
</DirectEvents>
</ext:FileUploadField>

Try this: click to "DosyaSec" and press to F12 and redirected code behind. Maybe help you.

Related

How to click on toggle button using VBA Selenium

Can sameone help me to click on a toogle button using VBA/Selenium:
HTML:
<img name="toggleFiltro" src="https://curyempreendimentos.sienge.com.br/sienge/imagens/base/toggleDown.png" onmouseover="IH_toggleOver(this)" onmouseout="IH_toggleOut(this)" style="cursor: pointer;">
Here is what I tried so far, but it's not displaying the information:
ChromoLink.FindElementByXPath("//img[#src='https://curyempreendimentos.sienge.com.br/sienge/imagens/base/toggleDown.png']").Click
and this one:
ChromoLink.FindElementByXPath("//*[#name=""divFiltro""]").Click
I got it:
ChromoLink.FindElementByXPath("//*#id=""holderConteudo2""]/form/div[9]/span/img").Click

VB.net webbrowser control click radio button

how to click the radio button for
<input name="years_option" value="all_years" type="radio">
the following code does not work. please help.
WebBrowser1.Document.GetElementById("years_option").SetAttribute("all_years", "radio")
at last got the answer from another source.
WebBrowser1.Document.GetElementById("years_option").SetAttribute("checked", True)

How to set DataNavigateUrlFormatString dynamically ? or How to eval Page.User.Identity.Name on a webpage?

I am building a GridView which can download songs. So I use a hyperlink fileld and use DateNavigateUrlFormatString.
E.G.
DataNavigateUrlFormatString="~/uploads/{0}"
Now,
I need to combine Page.User.Identity.Name into DateNavigateUrlFormatString
For example,
DataNavigateUrlFormatString="~/uploads/UserName/{0}" which Page.User.Identity.Name depending on the user login.
I tried to access DataNavigateUrlFormatString from the code behind but I couldn't.
I tried to use Eval such as
'~/uploads/" <%# Eval("Page.User.Identity.Name") %> /{0}'
this doesn't work as well.
Hope someone could point me out.
Thanks,
L
FInal Solution
<asp:TemplateField HeaderText="Play">
<ItemTemplate>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl = '<%# String.Format("~/UserUploads/{0}/",Page.User.Identity.Name)+ "/" + Eval("Song_Name") %>' Text="Play" >
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
DataNavigateUrlFormatString expects the placeholder(s) to come from fields in the datasource of the control.
My suggestion is that since you already know the url you are trying to build you could set the NavigateUrl property of hyperlink control.
NavigateUrl = '<%# String.Format("~/UserUploads/{0}/",Page.User.Identity.Name)+ "/" + Eval("Song_Name") %>'

Making asp:Label a specific HTML tag

New to VB.net, just trying to figure out how to properly manipulate the asp:Label control.
I have a page that, based on if there are results, etc should display an <h1></h1> tag with a header, then the data. As I am using the code-behind model, my user facing page essentially just has the following:
<asp:Label ID="lblMessage" runat="server"
Visible="false" />
<asp:DataList ID="dlCurriculumLists" runat="server"
DataSourceID="sdsCurriculumLists"
DataKeyField="Entry No_"
RepeatLayout="Flow"
Visible="false">
<ItemTemplate>
<div>
<asp:HyperLink ID="hlCurriculum" runat="server"
Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>'
NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "File Path") %>'
ToolTip='<%# DataBinder.Eval(Container.DataItem, "Title") %>'
Target="_blank"
Style="font-weight: bold;">
</asp:HyperLink>
</div>
</ItemTemplate>
</asp:DataList>
On my code-behind page, I then set the asp:Label and asp:DataList to Visible="true" based on the data from the database. Here's the catch - if there is data, I want to set lblMessage to be an H1, and if not, just standard Label text. I realize I can emulate the look through the CSS, but was just hoping there was another way (maybe similar to the ItemTemplate concept) to specify the HTML type of the Label control - it appears to be a by default.
For people coming from a VB background, it's a common mistake to think that the most basic control for displaying arbitary text is a Label.
That's not true. A label should label something, usually another UI control (that's what the AssociatedControlId property is for).
If you just want to display arbitrary text or HTML markup, use something more basic instead. Some examples are asp:Literal, asp:Placeholder or asp:Localize.
Using, for example, an asp:Literal called myLiteral, you can easily create a heading in code:
myLiteral.Text = "<h1>" & Server.HtmlEncode(myHeading) & "</h1>"
As far as I know, the asp:Label component will always generate a <label> HTML tag when its AssociatedControlId attribute is set.
What you could do instead is use a Literal Control and populate it with the HTML you wish at runtime.
UPDATE
One thing you could do to make this work as required using your current Label control is to have a theme for the label that marks it up as a H1. You could then toggle the controls EnableTheming property as required.
Aside from what already has been suggested here, you can also implement your own ASP.NET control with any properties you want, then modify its rendering on the fly, depending on the properties' values. It is pretty fun to do and is not as hard as one might think. Here is some information on the subject: http://msdn.microsoft.com/en-us/library/vstudio/zt27tfhy(v=vs.100).aspx

choose file box by clicking on image ? (not with browse button)

is it possible to show "choose file" window, when i click on some image ? i want to hide that input and browse button, which shows when i type
thanks
Long answer: Yes, you absolutely can. Get ready for some Javascript/CSS haxx that I cooked up. First the Javascript:
function getFilePathFromDialog() {
document.getElementById('fileBrowser').click();
document.getElementById('filePath').value = document.getElementById('fileBrowser').value;
}
Now the HTML:
<img src="path/to/image.jpg" onlick="getFilePathFromDialog();">
<input type="text" id="filePath" name="filePath" /><br />
<input type="file" id="fileBrowser" name="fileBrowser" style="visibility:hidden; display:none;" />
Basically all this does is hide the actual file dialog input field from view. When you click on your image it will fire the file dialog's click event. When the user chooses a file and clicks "Open", it will put the file path selected in the textbox called "filePath".
No, because of security restrictions in the browser. You have to go with Flash or Java to achieve that.