|
Please help me, I share some multimedia files over IIS website in local area. but every type of files are working except .DAT & .VOB extention. I put MP3, WMV, MPG, DAT, VOB files but upon clicking on link the browser shows that site not found but when clicking on MP3 or other files then the link works. I will be grateful if someone help me.
Julian
|
|
|
|
|
You have to register the mime type with IIS. To do this go to Admistrative Tools -> IIS Manager click on the computer and select Mime Types. Add the mimetypes for .DAT and .VOB.
Refer to the screenshot below:
MimeTypes.gif (37.9 Kb)
|
|
|
|
|
Thank you sir for your kind support. one more favour if you prefer that when i click on the link that was hyperlink in asp page browser goes to download rather than initiating media player and give control to media player. can i do this. i will be grateful.
Julian
|
|
|
|
|
hi there !
I'm new in asp.net , I want to add menu in the page like the menu of WinApplication .
thanx for any help !
s_mostafa_h
|
|
|
|
|
I'm really hating web development, since the last 2 weeks have been nothing but hell.
I have VS.Net 2005 on my PC (with the included SqlServer2005 dev tool).
I created 2 users for login control testing in the project (APP_DATA).
It appears that I can't get lost-password email to send because my pc isn't on the whitelist.
Our development web server is on the whitelist, but only has SQL Server 2000.
When I publish my project to the server, I get errors that SQLServer 2005 is not configured for remote access. Does this mean the project is trying to access my PC for the login stuff even though it resides in the project APP_DATA folder?
Will the database even handle the .MDF file, since it was created in a newer version?
How do I redirect this?
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
im currently doing a web application using C# & asp.net I need to access database in every webpage,can any of you refer me to examples or samples web applications or anything that can help
thanks
regards paula
|
|
|
|
|
No, we can't! This is because according to the n-tier architecture you website shouln't be able to gain access the database. Therefore you will need to create a business 'layer' or business project which will return your data.
In the business layer you gain access to your database and return an object to your website...
Example :
<br />
public class Clients : IDisposable<br />
{<br />
<br />
private SqlConnection _Connection = null;<br />
<br />
public Clients()<br />
{<br />
_Connection = new SqlConnection("ConnectionString")
}<br />
<br />
public DataTable GetAllClients()<br />
{<br />
}<br />
<br />
public DataRow GetClient(int ClientID)<br />
{<br />
}<br />
<br />
public int CreateClient(string Name)<br />
{<br />
}<br />
<br />
public bool UpdateClient(int ClientID, string Newname)<br />
{<br />
}<br />
<br />
public bool RemoveClient(int ClientId)<br />
{<br />
}<br />
<br />
public void Dispose()<br />
{<br />
if (_Connection != null)<br />
_Connection.Dispose();<br />
_Connection = null;<br />
}<br />
}<br />
<br />
This would make your web-app very neat, and you don't have to worry about the database connection anymore :->
|
|
|
|
|
I have a VB variable in an aspx page and want to pass its value to a javascript function within the same page. Any idea how to do this? The variables are read from a database thus:
Dim Lat As Double = CDbl(r("PlaceLat"))
Dim Lng As Double = CDbl(r("PlaceLng"))
and I would like them to be recognised by a google maps javascript line thus:
.
.
var point = new GLatLng(Lat,Lng);
.
.
<\script>
|
|
|
|
|
I did it this way after reading variables from database. Do not know if there is another better way.
Dim jsScript As String
jsScript = "jsVar = '" & VBVar & "';"
Dim cs As ClientScriptManager = Page.ClientScript
If (Not cs.IsStartupScriptRegistered("InitJSVar")) Then
cs.RegisterStartupScript(Page.GetType(), "InitJSVar", jsScript, True)
End If
|
|
|
|
|
Thanks for this. By doing this code, am I making jsVar available to any javascript on the page so that I can have:
var point = new GLatLng(jsVar,jsVar2);
or do I need to put all the code in the jsScript :
jsScript="" & vbCrLF
jsScript=jsScript & "jsVar = '" & Lat & "';"
jsScript=jsScript & "jsVar2 = '" & Lng & "';"
jsScript=jsScript & "var point = new GLatLng(jsVar,jsVar2);"
jsScript=jsScript & "<\script>"
Will the javascript then run where this is placed:
Dim cs As ClientScriptManager = Page.ClientScript
If (Not cs.IsStartupScriptRegistered("InitJSVar")) Then cs.RegisterStartupScript(Page.GetType(), "InitJSVar", jsScript, True)
End If
|
|
|
|
|
Yes, this way jsVar will be availeble on the page, and can be accessed in javascript. Since, this variable is declared on page so, its scope will be page.
In case you have two javascript variables that you want to initialized based on you database value, you will have to follow second approach.
By doing this you are generating javascript code on the server side that will be available on the page once loaded.
HTH
|
|
|
|
|
This worked perfectly. As I was writing away a marker for each database record read, I had to make the key (InitJSVar) a string so that I could change the key each time a new record was read ie first record = InitJSVar1, second record= InitJSVar2 ...etc
Many thanks
Will give you 5 rating
|
|
|
|
|
As I said here ~
you can use server-side hidden field to communicate between client-side and server-side.
<input id="Hidden1" type="hidden" runat="server"/>
In Form_load
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
Hidden1.Value = "13";<br />
}
You can set like that..
In Client-side ~
<script language="javascript" type="text/javascript"><br />
function getvalue(){<br />
var var1 = document.getElementById('Hidden1').value;<br />
}<br />
</script><br />
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.
|
|
|
|
|
Thanks for assisting me - I ened up using peacefulmember's solution
|
|
|
|
|
Another Easy option might be to use inline tags. Some people like it some hate it. If you feel that it is cleaner than the other options you can do something like this.
<script type="text/javascript>
.
.
var point = new GLatLng(<%= Lat%>,<%= Lng%>) ;
.
.
</script>
Co-Author ASP.NET AJAX in Action
|
|
|
|
|
Thanks for your help - I ended up using peacefulmember's solution
|
|
|
|
|
For what it's worth, I believe there's an article somewhere on CP where someone wrapped all this google maps stuff into a control which would do all of this. I didn't actually use it, so it may relate to an older version of the API, but I am pretty sure it exists, it's worth looking into.
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 )
|
|
|
|
|
You already have a thread about this[^] that you created only a few hours ago, where I already have shown you how to do this. Please keep it in a single thread.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for taking the time to assist me. I ended up using peacefulMember's solution
|
|
|
|
|
You should specify the format when you convert the value to a string. His solution only works for floating point numbers if the current culture happens to use period for decimal separator.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
i am trying to call 2 different javascript function using
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "OnLoad", "<script>HidePreviousAddressSection()</script>");
and
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "OnLoad", "<script>HideControl()</script>");
But only one javascript function get registered How can we call 2 function as i have to call 2 function after checking some business logic
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Can't you put both functions in the same javascript tag?
this.Page.ClientScript.RegisterStartupScript(this.GetType), "OnLoad", "<script>HidePreviousAddressSection();HideControl();</script>");
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
You can't register two script blocks with the same name. The type and name is used as an identifier for the script, so that different controls can add the same script block without it being repeated.
Just give the blocks different names:
ClientScript.RegisterStartupScript(this.GetType(), "HideAddress", "<script>HidePreviousAddressSection()</script>");<br />
ClientScript.RegisterStartupScript(this.GetType(), "HideControl", "<script>HideControl()</script>");
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi Guffa,
Thats why you are called MVP of CP. i really didn't know that 2 paramter is identifier for the script i thought it is the Event after which the script is going to call
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
Got a user control in my master page. I want to access the prperty of user control from the main page. How can I do that?
Thanks
<!-- Master Page -->
<%@ Register TagPrefix="ucl" TagName="myCntrl" Src="~/UCL.ascx" %>
<ucl:myCntrl runat="server" />
<!-- User Control -->
Partial Class UCL
Inherits System.Web.UI.UserControl
Priavte x as String = ""
Public Property ConCatStr() As String
Get
Return x & "Color"
End Get
Set(ByVal value As String)
Dim x As String = value
End Set
End Property
End Class
<!-- Main Page -->
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Want to refer controls's ConCatStr property on PostBack
End Sub
|
|
|
|