|
yes you have to do as same as sandeep said.
|
|
|
|
|
Hi,
Thank you very much for your idea.
Regards,
Periyasamy.R
|
|
|
|
|
Where ever you are advertising your site(putting a link), add a querystring that tell you it was directed from a certain site (you can also put site specific query string to know which site led to yours!). So now, when your site is hit, you can get from the querystring that it was directed to yours from XYZ place...
For going to other site from yours, you can always know that someone is navigating away from your site. Capture that in your event and use it the way you want. To be more sure, you can add some javascript code to the links that are being clicked. In the javascript code, using XMLHTTP Request handle the click event counter to your need.
|
|
|
|
|
Thank you for this information. I will try to implement this.
Regards,
Periyasamy.R
|
|
|
|
|
Hi, I could understand with your idea.Can you post some example?
Thanks you
Periyasamy.R
|
|
|
|
|
Hi,
Thank you very much for your idea. its very useful.
Regards,
Periyasamy.R
|
|
|
|
|
Hi all
I have a work to integrate two different web application in one
1. First one use Enterprise Library 4.1(say Microsoft.Practices. EnterpriseLibrary. Logging, Version=4.1.0.0)
On the other hand
2. Second one use two thirdparty
a) Enterprise Library 3.1(say Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0) and
b) CompositeWebClientLibrary-2008( say Microsoft.Practices.CompositeWeb.dll version 2.0.2)
We know, CompositeWebClientLibrary-2008 have strict dependence on Enterprise Library 3.1
* Based on above issues, I have to update Second one using Enterprise Library 4.1.
* Its clear to us: if we update Second one using Enterprise Library 4.1 the existing CompositeWebClientLibrary-2008 does not support Enterprise Library 4.1.( bcoz CompositeWebClientLibrary-2008 have strict dependence on Enterprise Library 3.1)
Please help me by informing about such CompositeWebClientLibrary that supports Enterprise Library 4.1
shahdat
|
|
|
|
|
Hi
I have a detailsview which uploads 4 files and uses the objectcontainerdatasource. However, what I would like to do is once I got my files from the fileupload object is to cast it to FileInfo type.
At the moment I can get hold of the files via detailsview but this is where I need help; as I have four files to upload, I want to save them to either an array, collection or list of type FileUpload or FileInfo (preferably FileInfo) along with two other properties and then to pass these values to a method that saves these files to a temporary location. This brings me to my next problem. In the method that saves the files to a temporay location, whilst I can do this with FileUpload, I want to return from this method the new file path location as a FileInfo type in order to use this in another method.
Can anyone help me with this?
|
|
|
|
|
Hi! I don't understand you at 100%. but maybe if you use a FileInfo[] fi = new FileInfo[4]... etc. And after store the images, you can use any to find it's path. like
String path = fi[0].FullName.subString(0, fi[0].FullName.LastIndexOf("/"));
String path = fi.DirectoryName; 
|
|
|
|
|
Hello
I work on an intranet site management fees.
management part of review tired me, I chose to work with Excel for simplicity
That's what I want to do:
I have a listbox containing the modules , for a list of students registered in a module, the responsable for this must complete an authentication form.
I want that after authenticating the excel file containing the student opens (I do not know if this is the right method, you comments are welcome)
to export data from sqlserver to excel I used this code:
cn.Open();
SqlDataAdapter da = new SqlDataAdapter(@"DECLARE @MATIERE nvarchar(max)
SELECT @MATIERE =
STUFF(
(
select distinct ',[' + LIBELLE_MATIERE + ']'
from MATIERE where CODE_MODULE =11
for xml path('')
),
1,1,'')
DECLARE @SQL nvarchar(max)
SELECT @SQL = N'
select
*
from (
SELECT ETUDIANT.NUM_INSCRIPTION, ETUDIANT.NOM_PRENOM_ETUDIANT_ARABE,EXAMEN.CODE,
EXAMEN.NOTE,
MATIERE.LIBELLE_MATIERE
FROM ETUDIANT INNER JOIN
EXAMEN ON ETUDIANT.NUM_INSCRIPTION = EXAMEN.NUM_INSCRIPTION INNER JOIN
CAPITALISE_MODULE ON
ETUDIANT.NUM_INSCRIPTION = CAPITALISE_MODULE.NUM_INSCRIPTION INNER JOIN
MATIERE ON EXAMEN.CODE_MATIERE = MATIERE.CODE_MATIERE INNER JOIN
MODULE ON CAPITALISE_MODULE.CODE_MODULE = MODULE.CODE_MODULE
AND MATIERE.CODE_MODULE = MODULE.CODE_MODULE
WHERE (CAPITALISE_MODULE.CODE_MODULE = 11) AND
(CAPITALISE_MODULE.CODE_TYPE_RELATION_MODULE = 1)
) Data
PIVOT (
SUM(NOTE)
FOR LIBELLE_MATIERE
IN (
' + @MATIERE + '
)
) PivotTable
'
exec sp_executesql @SQL
", cn);
DataTable dt = new DataTable();
da.Fill(dt);
cn.Close();
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
string sep = "";
foreach (DataColumn dc in dt.Columns)
{
Response.Write(sep + dc.ColumnName);
sep = "\t";
}
Response.Write("\n");
int i;
foreach (DataRow dr in dt.Rows)
{
sep = "";
for (i = 0; i < dt.Columns.Count; i++)
{
Response.Write(sep + dr[i].ToString());
sep = "\t";
}
Response.Write("\n");
}
}
}
this code works with sql queries simple but with my query i had an empty excel file (I tried this query and she is correct).
Should I display data in gridview and the user clicks on a button to export to excel?
If a person already working on this project thank you to advise me.
Thank you very much.
|
|
|
|
|
I think you should debug your code first and see what you get in DataTable.
if it is working fine then you can think of other option.
|
|
|
|
|
Thank you very much Viral Upadhyay,
My code work I, it gives me a dialog box to open or register the excel file .but it is in the server or the client?
if the file is in the server how to send the client by simple download or???
Thanks
|
|
|
|
|
Actually i am taking about is your datatable which fetch data from database has record or not?
but its look like you have done every thing right.
By the way the dialog box you see is for download or open file from server to client.
|
|
|
|
|
Thank you very much Viral Upadhyay
my english is bad i undrstand that the dialog box will be open in the pc of teachers and they will record notes and then send files to servers or directly to the database.
thank you.
|
|
|
|
|
Hi my datalist web control is bound to a database. i want to display google adsense after 3rd row. i am not sure how i can do that. could someone please help or guide me to right direction
|
|
|
|
|
I haven't done this, but the first thing I would try is using the OnDataBinding event of the datalist and insert a row if the index is 3. Make sure you don't lose the 4th row of data though.
|
|
|
|
|
could you please give me some coding tips as in how to not lose 4th row?
|
|
|
|
|
please how do i achieve this in a web program.
catch (Exception ex)
{
MessageBox.Show(ex.Message+" "+"Cannot establish the connection:" , "Connection error");
return null;
}
return cn;
}
this a class for connecting to my database.
|
|
|
|
|
Alter it to return a true/false to your webform then use a reponse.write method to generate a javascript call to the alert function with whatever message you want to show the user.
This will be the closest to what you want to do unless you want to try using Ajax Modal Popups.
|
|
|
|
|
If you have/put a scriptmanager on your page/masterpage you can do it similar to this:
private void ShowPopup(string text)
{
string alert =
"javascript:alert(\"" + text + "\");";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alertscript", alert,true);
}
.....
catch (Exception ex)
{
ShowPopup(ex.Message+" "+"Cannot establish the connection");
return null;
}
return cn;
}
|
|
|
|
|
this is good stuff, but not very clear,
please could you explain the code;
in my case i have a class not the code behind class, it only does my connection,
i want to display the error message incase the connection fails.
thanks.
|
|
|
|
|
In general with a multi-tiered application the lower tiers should not know about the tiers above them. Your connection class should probably throw an ApplicationException (or better yet a custom exception derived from it) and your codebehind in the page should do a try catch and catch that particular type of exception and use the code to do the web popup.
|
|
|
|
|
You're right, this code requires to be in your page class / codebehind.
If you are trying to show a messagebox within your business logic or data layer (other class/ assembly),you should rethink that.
Try to develope your business layer as unaware of your UI as possible. Therefore, don't
show a messagebox within that BL-Class, just "raise an event" or somehow inform an interested caller about the exception (for example the page which then displays the messagebox).
I'll explain that later if necessary, as i have to go home now unfortunately:/
|
|
|
|
|
You can do it using Page.ClientScript.RegisterStartupScript .
Like :
String alertScript = "<script language='javascript'>alert('" & strMsg & "')</script>"
Page.ClientScript.RegisterStartupScript(GetType(Page), "PopupScript", alertScript)
You may also have look into this :
ASP.NET Alerts: how to display message boxes from server-side code?[^]
|
|
|
|
|
Hi,
I create a gridview which with product name and sold count in 14 regions, I put the 14 region header text in vertical orientation to fit the region text.
I put the gridview in a panel like the following, when product list is longer, the vertical scroll appear.
<asp:panel id="Panel1" runat="server" height="690px" width="100%" scrollbars="Vertical">
<gridview id="GridView1">
Everything is fine if I resize the window, the header width and gridview width are resized.
The problem is that if I want to fixed the header by using the following css:
.header1{
height:20px;
padding: 0px;
font-weight:bold;
position: absolute;
background-color:Whte;
margin-top:-3px;
margin-left:0px;
}
And add the <headerstyle cssclass="header1"> for between <gridview> tag, the header is fixed, but if I change the window size, the header size won't change, only girdview width change, this makes the fixed header is longer than girdview.
How can I solve this problem?
Thanks a lot.
|
|
|
|