|
you can do it with javascript & css
<script>
function show(){
document.getElementById('popupform').style.visibility = 'visible';
document.getElementById('popupform').style.display = 'block';
}
</script>
<div id="hoverbtn" onMouseOver="show()">btn text</div>
<div id="popupform"> form goes here </div>
|
|
|
|
|
I have a html page that sends a message to my tomcat server to create and save a csv file. On the html itself is the link to the created file but it's hidden until the server completes the request. Once the file is created, a response is sent to the html to display the link to that particular file. Instead of having the file contents open up in the browser, how do I force it to display a save as dialog?
I read somewhere that you need to change the header to "Content-Disposition". Is that something I need to do after creating the text file on the server and before sending a response to html page? Or should this get handled on the a href tag where I can link it to a jsp file on the server to handle the forced download?
Any help would be much appreciated!
|
|
|
|
|
here is php code for a csv file. jsp should be similar:
header("Content-Transfer-Encoding", "binary");
header('Cache-Control: maxage=3600');
header('Pragma: public');
header('Content-type: application/csv');
header('Content-Disposition: attachment; filename="exportclients.csv"');
readfile('exportclients.csv');
|
|
|
|
|
and you may want to use:
application/force-download
|
|
|
|
|
|
Hi,
I have create web project and use ASP.NET C# 2.0,SqlServer2005,Ajax Etc
When I have create setup and install on client machine then install on client machine
.net framework/Sqlexpress and create database but ajax install manualy and change
web.config in Connection string as
<add key="ConnectionString" value="server=MachineName\SQLEXPRESS; database=Database; trusted_connection=yes;">
But I have need Install on client machine one click
How to add ajaxSetup in Web Setup and change web.config and
if client machine not have iis then how to create IIS and virtual directory and run application
Please can any body help.
Thanks & Regard
|
|
|
|
|
how can get content management editor in my site ?and how can manage contents in our web site using content mangement editor in asp.net with c#?
|
|
|
|
|
you can either build one from scratch (expect a few weeks work depending on how big it needs to be) or you can install a premade one try googling along the lines of:
"asp.net content management system c#" or
"simple asp.net cms" etc
|
|
|
|
|
Based on my coding, i can upload image to my server,and all image is renamed absed on the time()...so if i wan to display it out, what should i do since the filename may b different?
<?php
define ("MAX_SIZE","100");
function getExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}
$errors=0;
if(isset($_POST['Submit']))
{
$image=$_FILES['image']['name'];
if ($image)
{
$filename = stripslashes($_FILES['image']['name']);
$extension = getExtension($filename);
$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif"))
{
echo '<h1>Unknown extension!</h1>';
$errors=1;
}
else
{
$size=filesize($_FILES['image']['tmp_name']);
if ($size > MAX_SIZE*1024)
{
echo '<h1>You have exceeded the size limit!</h1>';
$errors=1;
}
$image_name=time().'.'.$extension;
$newname="images/".$image_name;
$copied = copy($_FILES['image']['tmp_name'], $newname);
if (!$copied)
{
echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;
}}}}
if(isset($_POST['Submit']) && !$errors)
{
echo "<h1>File Uploaded Successfully! Try again!</h1>";
}
?>
<form name="newad" method="post" enctype="multipart/form-data" action="upload.php">
<table>
<tr><td><input type="file" name="image"></td></tr>
<tr><td><input name="Submit" type="submit" value="Upload image"></td></tr>
</table>
</form>
http://CodeBasic.net
|
|
|
|
|
you can store the name as a session variable and then use it or for a more permanent soultion record the name in a database so you can use it repeatedly.
|
|
|
|
|
I need to know if there is anyone that can help with this ejb's. I'm just trying to set up a simple timer. I want to set it up in intervals plus I need to know what all does the ejb needs. And its ejb3.0 and ejb is Enterprise Java Beans. The code is below:
Client: -> did have something but wasn't working correctly.
package ejb30.STClient;
import ejb30.STBean.*;
import javax.ejb.EJB;
import javax.ejb.TimerService;
import javax.naming.*;
public class Client
{
}
Remote:
package ejb30.STBean;
import javax.ejb.Remote;
import javax.naming.NamingException;
@Remote
public interface STBeanRemote
{
public void Timer();
}
Bean:
package ejb30.STBean;
import javax.annotation.Resource;
import javax.ejb.Stateless;
import javax.ejb.TimedObject;
import javax.ejb.TimerService;
import sun.misc.Timer;
@Stateless
public class STBean implements STBeanRemote, TimedObject {
@Resource
private TimerService gog;
public void setSessionContext()
{
}
public void Timer()
{
Timer ts = (Timer) gog.createTimer(0, 15000, null);
}
@Override
public void ejbTimeout(javax.ejb.Timer timer)
{
System.out.println("I'm working");
}
}
XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
<ejb-jar xmlns ="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://ww.w3.org/2001/XMLSchema-instance"
metadata-complete="true" version="3.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/nx/javaee/ejb-jar_3_0.xsd">
<enterprise-beans>
<session>
<display-name>STBean</display-name>
<ejb-name>STBean</ejb-name>
<business-remote>ejb30.STBean.STBeanRemote</business-remote>
<ejb-class>ejb30.STBean.STBean</ejb-class>
<session-type>Stateless</session-type>
<transaction>Container</transaction>
<security-identity>
<use-caller-identity />
</security-identity>
</session>
</enterprise-beans>
</ejb-jar>
I edited it with the proper tags... please help.
|
|
|
|
|
|
Hi
Hope someone can help with this as I'm feeling a bit stupid at the moment!
I've got a form (using a master page and an update panel in case it's relevant). This is also (and unfortunately needs to) running in IE6.
On there are 3 text boxes which are pre-populated server side. When the value of one of these changes, I need to update another part of the screen (client-side, this doesn't need to go back to the server). So, each of those text boxes has:onFocus="storeValue(this)" onBlur="leavingField(this) so that on entry to the field the value is stored in a global variable and on exit this is checked and actioned if it has changed. The first time you enter and exit a field it behaves as expected, subsequently you get a 'Function Expected' error.
The relevant code is:
var valStore;
function storeValue(field) {
valStore = field.value;
}
function hasValueChanged(val) {
if (val != valStore)
hasValueChanged = true;
else
hasValueChanged = false;
}
function leavingField(field) {
if (hasValueChanged(field.value)) {
var prefix = (ctlPrefix + curr);
calculateSingleDifference(field.id.split(prefix)[1]);
field.className = (field.className + ' changedValue');
}
}
The error is raised the second time 'hasValueChanged' is called in 'leavingField'.
Any ideas gratefully received!
Thanks in advance
Ben
|
|
|
|
|
Bjohnson33 wrote: function hasValueChanged(val) {
if (val != valStore)
hasValueChanged = true;
else
hasValueChanged = false;
}
well, to start with you got hasValueChanged both as function name and variable name. I can see where that originrated
try this for a size,
function hasValueChanged(val) {<br />
if (val != valStore)<br />
return true;<br />
else<br />
return false;<br />
}
|
|
|
|
|
Thanks Yusuf, exactly right - was obviously having a syntax meltdown - fifth language this week!
Ben
|
|
|
|
|
Hi,
I want to make a Quick Search Text box in my site. User can enter anything in quick search textbox and press the search button.
I want to populate my gridview with any product which has a word which the user entered in the text box.
For example if the user enters black in the textbox to search, I want to show
all black products like black pen, black book, black umbrella etc. It will be like a search button using SQL Server database.
could you please help me to set up this?
Thanks
modified on Friday, May 15, 2009 2:46 AM
|
|
|
|
|
CHANDUA wrote: It will be like a search button.
Except it will be quicker.
Where is your data coming from?
|
|
|
|
|
SELECT * FROM your_database_table WHERE Name = '%ENTERED_TEXT%'
That should get the info from the database. Dont forget the percent symbols - they will get anything that is simlar to the entered text.
If you are unsure what to do with this I suggest you google "asp c# sql tutorials" (I presume you are using asp & c# - if not replace this with the technology you are using) or hire a web designer.
|
|
|
|
|
Hi all,
Have created and published a website which has then been installed to a virtual directory using IIS.
However, when I try to get access to the default.aspx page through IE, I get a 'page not found' error. Its the same for every page which was included in the site, there are only 3.
I created a test.txt file in the same directory as the website after installing through IIS, and I can get access to this through IE using the website's IP. Nothing appears through localhost, not any of the web pages nor test.txt. I can't even get a directory content listing to display.
Anyone know what I've forgotten to do and would like to tell me please?
Thanks in advance.
Scott
|
|
|
|
|
sounds like a permission issue have you checked the directory permissions?
|
|
|
|
|
<HTML>
<script Language="javascript">
function printfile()
{
window.frames['objAdobePrint'].focus();
window.frames['objAdobePrint'].print();
}
</script>
<BODY>
<iframe src="Test.pdf" id="objAdobePrint" name="objAdobePrint" height="250" width="100%" frameborder=0></iframe><br>
<input type="button" value="Print" onclick="javascript: printfile();">
</BODY>
</HTML>
the above code working in Firefox browser, but its not working in safari browser.
if i try to print this pdf file in safari browser i am getting empty page print out.
if i open any pdf file in firefox browser, i can print that pdf file from toolbar File->Print option,
but its not working for safari browser.
any one can help me for above issue?
|
|
|
|
|
Hello,
I am new to the forum and am seeking some advice about my website redesign.
We are creating an ASP.NET site with a sql backend. Our site is a heavily content-based site. We are looking to have an English and Spanish site. Ideally, I would like all the content to be stored in a separate file or db.I have read a few articles about localization but still have some unanswered questions.
My questions are as follows:
1. Considering that most of our content is comprised of many paragraphs, what is the best method to store the content? Is it best to use sql db rather than xml to store text? (I have seen arguments for both and am leaning toward sql db.)
2. Will there be significant delays with displaying content given the fact that the site is such a heavily content-based site?
Thank you in advance for your suggestions and input.
Allison
|
|
|
|
|
Seems you are building some kind of CMS (Content Management System), anyway in such cases where you store too much paragraphs and they are localized I think you should go toward database. If you designed the app very well and took in consideration all minor details trust me performance will eliminate it self on the spot. having Xml is something horrible for large texts that you will have to live with through the development and maintenance life cycles of the your app.
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
Hi, I have a login page with a asp:Login control. and i want to populate a session variable with the userid if logged in the user.
here is what is have.
Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn
Dim m As MembershipUser = Membership.GetUser()
Dim UserID As String = m.ProviderUserKey.ToString()
session("userid") = userid
End Sub
and i get this error
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 27:
Line 28: Dim m As MembershipUser = Membership.GetUser()
Line 29: Dim UserID As String = m.ProviderUserKey.ToString()
Any help
|
|
|
|
|
Hi there,
Why would you use the ProviderUserKey property to get the user name ?! you can simply use the UserName property to get it.
And try making sure which object is null ? is it the returned MembershipUser object or the ProviderUserKey, my guess is ProviderUserKey.
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|