|
Hi Michael
Thanks for ur response.
I have done it.Its working fine in IE7 but I am not getting Click Event of Button In mozila.
whats a problem?
Thanks again
Pathan
---------------------------------------------------
|
|
|
|
|
Try this code ~
----------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<style type="text/css">
.file{
filter:alpha(opacity=0);
-moz-opacity .0;
opacity: 0.0;
position:absolute;
left: -150px;
}
</style>
<script language="javascript" type="text/javascript">
function fireFileClick(){
var objfile = document.getElementById('myFile');
objfile.click();
var objTextBox = document.getElementById('txtPath');
objTextBox.value = objfile.value;
}
</script>
</head>
<body>
<input id="myfile" type="file" class="file" />
<input type="button" id="btnUpload" value="Upload" onclick="fireFileClick();" />
<input type="text" id="txtPath" />
</body>
</html>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
look michael I want to use this trik in my web side but the page is including master page and i want to use fileupload not input upload i tried it but it gives me some errors i'll post you the code to see it and if you could help me i will be grateful to you
the code
<%@ Page Language="C#" MasterPageFile="~/admin/MasterPage1.master" AutoEventWireup="false" CodeFile="~/admin/decleration_edit.aspx.cs" Inherits="decleration_edit" Title="تعديل كلمة الوزير" StylesheetTheme="style1" Theme="style1" %>
<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder1" runat="Server">
<asp:fileupload id="FileUpload1" runat="server" enabletheming="True">
<asp:button id="Button1" runat="server" onclientclick="fireFileClick()"
="" text="تصفح....." onclick="Button1_Click">
<asp:textbox id="TextBox1" visible="false" runat="server" height="16px" style="right: 23px; position: relative;
top: 2px" width="152px">
thx
let's work together |
|
|
|
|
|
Hi ahmed_fci2006,
Can you post your code again with "Ignore HTML tags in this message" checked? I can't see your code clearly..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
<%@ Page Language="C#" MasterPageFile="~/MasterPage2.master" AutoEventWireup="false" CodeFile="final.aspx.cs" Inherits="test_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
<!--
<!--
function fireFileClick()
{
var objfile = document.getElementById("<%= File1.ClientID %>");
objfile.click();
var objTextBox = document.getElementById("<%= Text1.ClientID %>");
objTextBox.value = objfile.value;
}
</script>
<br />
<asp:FileUpload ID="File1" runat="server" />
<br />
<asp:Button ID="Button1" OnClientClick="fireFileClick()" runat="server" Text="ASPNET Button" />
<input id="Text1" type="text" runat="server" />
<br />
<br />
<input id="Button2" type="button" onclick="fireFileClick()" value="HTML Button" />
<br />
<br />
</asp:Content>
let's work together
|
|
|
|
|
what is the code for recurrence(reminder) in calendar....
Recurrence means repeating activity periodically...
Daily, Weekly, Monthly, Yearly
System will ask for start and end time each interval types.
System will have option to select a day e.g. every Friday - Weekly interval
System will have option to select a date e.g. every 15th - Monthly interval
System will have option to select a date and month e.g. very 15th of June - Yearly interval
|
|
|
|
|
1. Read the forum guidelines.
2. Give your messages titles with meaning.
3. Do you own homework.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
I'm new in asp
so I started with downloading IIS 6.0 from internet, then I installed it on my system.. anyways , install is succesfull, but IIS doesnt appear on my services list.. It must be very simple but I would appreciate if sbody does help me..
|
|
|
|
|
methhoo wrote: I started with downloading IIS 6.0 from internet
Say what?
The IIS version that you should use is on your Windows disk. You can't install any other version of IIS than the one intended for your version of Windows.
(There is a possibility to hack Windows, so that it's possible to install an IIS version from a different Window version, but if you are doing this, you are pretty much on your own. You can't have found a description of how it's done without seeing the warning that it's totally unsupported, and may make your system instable.)
methhoo wrote: then I installed it on my system
Eh... How? Are you sure that it's really IIS that you downloaded, and not something completely different? Like a trojan?
methhoo wrote: install is succesfull, but IIS doesnt appear on my services list
Then I wouldn't call it successful...
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello guys,
I'm struggling a problem now for some days. Hopefully one of you guys can help me out with that.
I wrote my own VirtualPathProvider and VirtualPathFile to make it possible to load different pages from different locations. It works very good. But now I need to load the pages from different locations depending on a value stored in the session. The time when VirtualPathprovider is invoked the Session object is not available or lets say it's available but null.
Now I found out that the session object is filled when the AcquireSessionState event is invoked, but thats to late for me because the action of loading the page already passed. So now I want to create the session by my own before the AcquireSessionState is invoked. But I don't know how to fill the session object by my own.
Does anybody can help me with this problem? Or has anybody a better idea then filling the session object by my own.
Thanks a lot for any input
Oliver
|
|
|
|
|
A thought!..Can you use cookieContainer!! or HttpApplication instance!!
|
|
|
|
|
Hi,
Thanks for the input, but I use cookieless sessions.
I tried to retrieve session data from different locations:
HttpContext.Current.Session - null at this time
HttpContext.Current.ApplicationInstance.Session - null at this time as well
I guess thats because the AcquireSessionState is called later on - where the session object is filled.
What I want to do now is to try initialize the Session earlier, but I don't know if it's possible.
Thanks
Oliver
|
|
|
|
|
Hi peacefulmember,
I have to apologize. I use cookies without my knowledge
Now that I know that I use cookies I found out that there is a cookie in which the session id is stored. I save now the value which I wanted to store in the session also in the cache with following statement:
<br />
Cache[Session.SessionID + "_MyKey"] = Value;<br />
The difference to just saving it in the session is that the cache is available every time and the cookies are already present at the time I need to get the value. So in my VirtualFile I added following code to retrieve the value again:
<br />
if (HttpContext.Current.Request.Cookies["ASP.NET_SessionId"] != null) {<br />
value = (String)System.Web.Hosting.HostingEnvironment.Cache[HttpContext.Current.Request.Cookies["ASP.NET_SessionId"].Value + "_MyKey"];<br />
}<br />
That solved the problem for me. It's kind of a workaround. I would have preferred the "Session-Solution" but as the Session is not filled that time I have to solve it this way.
Thanks
Oliver
|
|
|
|
|
I have user control with some standard HTML tags. On one of my HTML button tag I want to perform a javascript validation (a Hello test function for now).
I cannot figure out how can I trigger this function from with in my user control on this HTML button tag click event or on usecontrol's click event.
Thanks in advance.
Partial Class MyUserControl
Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim js As StringBuilder = New StringBuilder()
js.Append("<script language=JavaScript>")
js.Append("function Hello() { ")
js.Append(" alert ('Hello'); }")
js.Append("</script>")
If (Not Page.ClientScript.IsStartupScriptRegistered("MyScript")) Then
Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", js.ToString())
End If
End Sub
End Class
|
|
|
|
|
Sorry, I messed up the subject earlier. But I meant to wish everybody. HI.
|
|
|
|
|
The easiest way is to use a custom validator, which can be made to call any function you like.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian,
Custom Validator!! Sorry, I am not too expert with .net.
Could you please explain this with an example?
Thanks
|
|
|
|
|
Since your javascript function is not dynamic, it's better to write in page itself than writing from code behind. Write your javascript function on usercontrol.
Assume you have a button tag like
<input type="button" id="Btn" OnClick="Hello();"> . This will invoke Hello() method when button is clicked.
|
|
|
|
|
I do not want to write my javascript in the page itself. Validations are different in the case of different parameters passed to the user control.
What do you mean by that javascript function is not dynamic..How can I make it dynamic, if that can lead me to the functionality that I want? So, far I was thinking my javascript is dynamic as I have it in page_load and it will be written to the page after form tag is rendered on the page side.
Thanks
|
|
|
|
|
Well, I have one more question. Like I mentioned based on user control's parameter value I need to perform different client side validation.
I could set parameter of user control (have a property, suggest if there is another better way), but how can I use this property value in Javascript?
Thanks for bearing with me.
|
|
|
|
|
just reply the triggering code u hav...
Sarith...
|
|
|
|
|
Hi,
Here is the similar query, that I need:
SELECT News.NewsID, News.Headline, Images.ImageID<br />
FROM News INNER JOIN<br />
Images ON News.NewsID = Images.NewsID<br />
WHERE (News.Enabled = @Enabled) AND (Images.Favourite = @fave)
But this gives only those headlines that have there images, but I need all the headlines, and if they have images, then to get the favorite imageID, because they can have more than one image and only one of them is favorite.
thx
|
|
|
|
|
Do an outer join, so you get the columns you want, plus those where the image doesn't exist.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I tried all kinds of outer join (right, left, full), but it is still gives me only those columns that are both enabled and have images, but I also need those that don't have images, it should give me NULLs, if there is no image on images table.
thank you
|
|
|
|
|
I'm trying to select data from an MS Access Db and display it in a asp.net web form, but i'm getting the follwing compiler error message:
Compiler Error Message: CS0117: 'ASP.user_default_aspx' does not contain a definition for 'AccessDataSource1_Selecting'
Line 29: <asp:accessdatasource id="AccessDataSource1" runat="server" datafile="~/App_Data/Members.mdb"
key:-="" x="asp"
<code="">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="User_Default" %>
<x:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Members.mdb"
OnSelecting="AccessDataSource1_Selecting" SelectCommand="SELECT [USERNAME], [GALAXYNO], [SOLARNO], [PLANETNO], [LASTLOGIN] FROM [Members]">
</x:AccessDataSource>
<x:DataList ID="DataList1" runat="server" BackColor="Black" DataKeyField="USERNAME"
DataSourceID="AccessDataSource1" Font-Bold="False" Font-Italic="False" Font-Names="Arial"
Font-Overline="False" Font-Size="12pt" Font-Strikeout="False" Font-Underline="False"
ForeColor="White" HorizontalAlign="Center" RepeatColumns="5" CellPadding="2" CellSpacing="10">
<ItemTemplate>
Username:
<x:Label ID="USERNAMELabel" runat="server" Text='<%# Eval("USERNAME") %>'></x:Label><br />
Galaxy:
<x:Label ID="GALAXYNOLabel" runat="server" Text='<%# Eval("GALAXYNO") %>'></x:Label><br />
Solar system:
<x:Label ID="SOLARNOLabel" runat="server" Text='<%# Eval("SOLARNO") %>'></x:Label><br />
Planet:
<x:Label ID="PLANETNOLabel" runat="server" Text='<%# Eval("PLANETNO") %>'></x:Label><br />
Last Login:
<x:Label ID="LASTLOGINLabel" runat="server" Text='<%# Eval("LASTLOGIN") %>'></x:Label><br />
<br />
</ItemTemplate>
<HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Center" VerticalAlign="Middle" />
</x:DataList>
Regards, Michael
|
|
|
|