|
hi,
i need to display a popup control based on a condition in the server side. i need to check for every one minute and if the condition is true the popup should be displayed. i got this done by using setInterval and clearInterval methods.
But my client feels that there is a disturbance due to flickers, since the page is being posted back every one minute.
How can i accomplish the same using server side timer or how can i avoid the flickers occuring while posting the page back?
Please suggest me some ideas.
Is there any way to do this without using AJAX?
Thanks in advance.
Regards
Anuradha
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Hi Anuradha,
Try with the javascript as mentioned here
SSK.
|
|
|
|
|
Hello sir,
i used your source code for creatting database at runtime.but it shows me error in (using System.Web.UI.WebControls.WebParts).this namespace is not does not exist.now i am working in .net 2003.but i had tried to add to namespace in add reference.but i don't why error occurs in namespace.tell me how to add namespace.
Regards,
suresh
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
<b>using System.Web.UI.WebControls.WebParts;</b>
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
//private System.ComponentModel.Container components = null;
protected void Page_Load(object sender, EventArgs e)
{
SQLDMO.Application oSQLServerDMOApp = new SQLDMO.Application();
SQLDMO.NameList oNameList;
oNameList = oSQLServerDMOApp.ListAvailableSQLServers();
for (int intIndex = 0; intIndex <= oNameList.Count - 1; intIndex++)
{
if (oNameList.Item(intIndex as object) != null)
{
cboServers.Items.Add(oNameList.Item(intIndex).ToString());
}
else
{
cboServers.Items.Add("(Local)");
}
}
cboServers.SelectedIndex = 0;
}
protected void btnCreateDB_Click(object sender, EventArgs e)
{
string strDatabaseName = "";
SQLDMO.SQLServer gSQLServerDMO = new SQLDMO.SQLServer();
SQLDMO.Database nDatabase = new SQLDMO.Database();
SQLDMO.DBFile nDBFileData = new SQLDMO.DBFile();
SQLDMO.LogFile nLogFile = new SQLDMO.LogFile();
strDatabaseName = txt_Database.Text.ToString();
try
{
gSQLServerDMO.Connect(this.cboServers.SelectedItem.ToString(), this.txtUser.Text, this.txtPassword.Text);
nDatabase.Name = strDatabaseName;
nDBFileData.Name = strDatabaseName;
nDBFileData.PhysicalName = gSQLServerDMO.Registry.SQLDataRoot + "\\DATA\\" + strDatabaseName + "_Data.mdf";
nDBFileData.PrimaryFile = true;
nDBFileData.Size = 2;
nDBFileData.FileGrowthType = SQLDMO.SQLDMO_GROWTH_TYPE.SQLDMOGrowth_MB;
nDBFileData.FileGrowth = 1;
//Add the DBFile object
nDatabase.FileGroups.Item("PRIMARY").DBFiles.Add(nDBFileData);
//
nLogFile.Name = strDatabaseName + "Log";
nLogFile.PhysicalName = gSQLServerDMO.Registry.SQLDataRoot + "\\DATA\\" + strDatabaseName + "_Log.ldf";
nLogFile.Size = 2;
nDatabase.TransactionLog.LogFiles.Add(nLogFile);
gSQLServerDMO.Databases.Add(nDatabase);
Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script type=\"text/javascript\">alert('Database Sucessfully Created');</script>");
gSQLServerDMO.DisConnect();
}
catch (Exception SQLDBException)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script type=\"text/javascript\">alert('" + SQLDBException.Message + "');</script>");
return;
}
finally
{
}
}
}
|
|
|
|
|
Hi in my html page i have one combobox...,
In that i have list of values...,
Its showing the tooltip after select the value from that combobox...,
But i like to show when the user click that combo and he will go line by line records that time i like to show each and every record tooltip...,
Not only for html control combo,if its possible in dropdownlist(.net control) also no probs,
How to do that?,
Urgent need hlp me...,
-- modified at 1:12 Tuesday 4th September, 2007
Regards,
Magi
|
|
|
|
|
Hi
Please specify your combobox's "Auto postback" property is true or not? if true u can write code in code behind otherwise u can do it from Javascript.
I Have another question is it ur control is combo or ListBox ? beacause listbox only have multi selection
Regards
R.Palanivel
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
In any mode,
I need that tooltip for each items...,
May be postback also no probs or in javascrip also no probs,
Plz send me
-- modified at 1:59 Tuesday 4th September, 2007
Regards,
Magi
|
|
|
|
|
Add this code on "Page Load"
DropDownList1.Attributes.Add("onchange","fnToolTip()");
----------------
Add this javascript code on HTML Code view
<script language="javascript" type="text/javascript">
function fnToolTip()
{
selIndex=document.getElementById("DropDownList1").selectedIndex
selValue=document.getElementById("DropDownList1").value
// alert(selValue)
document.getElementById("DropDownList1").title=selValue
}
</script>
-------------------
Add this code on Body
<asp:DropDownList ID="DropDownList1" runat="server" Width="185px">
<asp:ListItem Value="IM1">ITEM1</asp:ListItem>
<asp:ListItem Value="IM2">ITEM2</asp:ListItem>
<asp:ListItem Value="IM3">ITEM3</asp:ListItem>
<asp:ListItem Value="IM4">ITEM4</asp:ListItem>
</asp:DropDownList>
--------------------
Try this should work fine
Regards
R.Palanivel
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
I have a roles based website, I'm using A master page.
Roles:Staff,Manager
A folder for staff and Manager
Now the problem the images in the master page go missing for the aspx pages in the staff and manager folders.
|
|
|
|
|
Check the Source file properly does it contain the imag tag ?
There could be many reasone to happened like that
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.....
use <asp:image> tag and take ImageUrl = "~/ImageFolder/FileName"
Try this....
|
|
|
|
|
hi all
i have a image type gif.
I want to export file PDF contain this image.
How can i do it with asp.net 2.0??
|
|
|
|
|
I'm working with "CheckBox command in Repeater" found here:
<a href="http://www.codeproject.com/useritems/CheckBoxCommand.asp">http://www.codeproject.com/useritems/CheckBoxCommand.asp</a>[<a href="http://www.codeproject.com/useritems/CheckBoxCommand.asp" target="_blank" title="New Window">^</a>]
I cannot find a way to update my database after checking the CheckBox. Which line is the culprit? What's missing?
You may download the aspx page with 1 table database, clicking <a href="http://www3.sympatico.ca/robert-duguay/a1.zip">here</a>[<a href="http://www3.sympatico.ca/robert-duguay/a1.zip" target="_blank" title="New Window">^</a>].
<code><%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<script runat="server">
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
// HERE I MESSAGE SELECTED CHECKBOX ID AND VALUE
CheckBox chk = (CheckBox)sender;
MessageLabel.Text = "ItemID: " + chk.Text + " Checked: " + chk.Checked.ToString();
// HERE I CHANGE THE DEFAULT VALUE IN UPDATE PARAMETER OF THE CHECKBOX
AccessDataSource1.UpdateParameters[0].DefaultValue = chk.Checked.ToString();
// TESTER PLUTOT HARD CODED
AccessDataSource1.UpdateParameters[0].DefaultValue = "True";
// HERE I RESPONSE.WRITE JUST TO MAKE SURE MY UPDATE VALUE WAS PASSED
Response.Write("Passed Update parameter: " + AccessDataSource1.UpdateParameters[0].DefaultValue);
// HERE IT DOESN'T WORK !!! WHY ???????????
AccessDataSource1.Update();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Checkbox Command Sample</title>
<meta name="Description" content="" />
<style type="text/css">
.HiddenText label {display:none;}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:Label ID="MessageLabel" runat="server" EnableViewState="false"></asp:Label> <h2>
Repeater Example</h2>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="AccessDataSource1">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" Checked='<%#Eval("Flag")%>' Text='<%#Eval("ItemID")%>'
CssClass="HiddenText" AutoPostBack="true" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged" />
<%#Eval("ItemDescription")%>
<br />
</ItemTemplate>
</asp:Repeater>
<br />
<br />
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/ldh.mdb"
SelectCommand="SELECT [ItemID], [Flag], [ItemDescription] FROM [Table1]"
UpdateCommand="UPDATE [Table1] SET [Flag] = ?, [ItemDescription] = ? WHERE [ItemID] = ?">
<UpdateParameters>
<asp:Parameter Name="Flag" Type="Boolean" />
<asp:Parameter Name="ItemDescription" Type="String" />
<asp:Parameter Name="ItemID" Type="Int32" />
</UpdateParameters>
</asp:AccessDataSource>
<br />
<br />
</form>
</body>
</html>
</code>
|
|
|
|
|
If you have a question about an article, the author is the best person to ask, and the best way to do that, is in the forum provided under the article itself.
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 )
|
|
|
|
|
Hello all.
I have this ASP.NET webform which has many data input in order to create an appointment. This data is stored in our database. Yet the customer has asked if it is possible to send the appointment into Outlook/Exchange so that the customer can receive an email with the appointment. Is there any component (.NET, COM) or any way to do this?
Thanks in advance.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Hi Fernando,
I would use the information from the database to create a vCalendar file (you can Google vCalendar format to get the specifics on how to build the file) and then send that as an attachment to the user to import into their Calendar.
Hope this helps.
|
|
|
|
|
Thanks! I'll look for this vCalendar file thing.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
hi everybody i have a problem with customising the javascript function for a validation control
i explain my pronlem with an exmple
i have two input on a table one is an email the other is the forename
a simple validation control for the email input is done
but when the email input is not empty i must
fill the forename input
so the html is like that
<asp:textbox id="forname" runat="server">
<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" errormessage="RequiredFieldValidator" ....=""> | <asp:textbox id="email" runat="server">
<asp:regularexpressionvalidator id="RegularExpressionValidator1" runat="server" controltovalidate="email"
="" errormessage="please write a valid email!!" validationexpression="^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$"> |
how can i overwrite the validartor for the forname text to have a function in javascript that on submit event
do amessage error if the email is valid and the forname input is not filled
i explain when someone fill the email the forname must be filled and when the email is empty no control for the two input
thank you for help!!
|
|
|
|
|
You need to write some code that stores the client side Ids of the two controls as javascript strings, then you can use those names to write a custom validator that finds both controls and does the validation for you.
You may also be able to use two normal validators, and write a custom one that calls both and only sets the valid state to false if both of them fail.
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 )
|
|
|
|
|
thank you christian for you answer but i am a beginner in validation controls may be an example or a portion of code could help me thank you in advance for your answer
|
|
|
|
|
OK, I think there is actually a control on this site which validates multiple controls, I'd suggest looking for that
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 )
|
|
|
|
|
helo alll...,
this is my data:
my table is item(productid,stock) ,order(customerid,no_order), and orderdetail (no_order,productid,quantity)
example:
order and orderdetail displayed in gridview....
order is displayed like this:
--------customerid-------no_order
detail-------A---------------1
detail-------B---------------2
when i click detail in row 2, it's display orderdetail:
no_order_________productid_________quantity
____2________________c1________________2
____2________________p1________________3
i have make all this is ok. but i want to decrease stok in item with quantity in orderdetail.
my code in procedure like:
CREATE PROCEDURE [dbo].[order_item]
(
@productid AS varchar,
@quantity AS INT
)
AS
BEGIN
BEGIN TRANSACTION
DECLARE @no_order AS INT
DECLARE @stock AS INT
INSERT INTO [Orderdetail]
(
[ProductId],
[Quantity]
)
VALUES
(
@productId,
@quantity
)
SET @no_order = SCOPE_IDENTITY()
SET @Stock = (SELECT [Stock] FROM [item] WHERE [ProductId] = @productId)
UPDATE [item]
SET
[Stock] = @Stock - @quantity
WHERE
[ProductId] = @productId
COMMIT TRANSACTION
END
return
it can't work..
how about his true code in store procedure?
ok..., thx..
-- modified at 14:41 Monday 3rd September, 2007
|
|
|
|
|
1 - use the right forum ( this is a SQL question )
2 - define 'it can't work', does it compile ? What does it return ?
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 )
|
|
|
|
|
Hello.
I have made a user information to store in session.
But when admin blocks the users, it shoud kill the users session if exsist.
I want to avoid using database.
|
|
|
|
|
You can't block the users session - the only way that you could do this would be to have some mechanism where the user queries to see if they still have access to things. You may be able to do this with the Cache if you want to avoid the database.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Then only one think is could be done.... By checking every time post back, if user is valid.
Does server being overloaded if every post back is checked by using database?
|
|
|
|