|
Whats your exact question ? where do you want to use form or div ?
|
|
|
|
|
If I create the web page inside a folder on the root, ... Create image folder in root file only... Now i run directly on subfolder page... i am not get the image from image folder....
Can you help to me
|
|
|
|
|
Good Morning nithydurai
Can we see the image reference code ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i create the reseller account...
i wil give one aspx page to reseller.....
image folder have in root directory
how to access the image folder on reseller .aspx page...
Image1.ImageUrl = Page.ResolveUrl("~/image/02.gif");
how to share a web.config file in different path..
|
|
|
|
|
You are really Confusing me, now you talk about account. I thought your only Problem is that you have an image folder that contains images and you have a sub folder that has a page and it does not show an image on the page, and i requested a part where you reference the image.
Please Please Explain Clearly exactly what is your problem , because i don't have a problem on my side.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi All
I have a web site. This web site connected multiple databases. After user(1st user) successfully logged in then we received database name, user id, and password and create a connection string and store the value in class file as a static property. Its work all over the website and class file. But my problem is that when another user (2nd User) login then class property is changed with (2nd User) connection string. An user(1st user) data changed with 2nd User data.
That means 1st user going connect with 2nd User database.
There I any way to recover from this problem, I don’t use different way. Because my project almost completed. Please help me out
Thanks
Rajesh
|
|
|
|
|
|
In class file session is not working properly.....
|
|
|
|
|
|
As I'm sure you are well aware, static properties values are shared (hence I believe the VB keyword for it) among all the application's instances. Which means your application is seriously flawed if you expose user data to other users.
The answer: don't use static properties the way you do.
Use normal properties.
And don't mean to be rude, but it seems your project is far away from completion, if you want it to work correctly.
var question = (_2b || !(_2b));
|
|
|
|
|
I agree with Greg. You are using static keyword without knowing how it works. Static variables will stay in memory until the application domain unloads and it is shared between all threads under that application domain. To solve this, Use session variables. These are unique for each visitor.
|
|
|
|
|
But how can I used session variable in class file, its through "Objects reference not set to be instant of an objects". Please check my class file.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.SessionState;
namespace MyStore
{
public class GetConnection
{
static string _conString = null;
public GetConnection()
{
//
// TODO: Add constructor logic here
//
}
public static String DBConnectionString
{
get
{
if (HttpContext.Current.Session["ConnStr"] != null)
{
return HttpContext.Current.Session["ConnStr"].ToString();
}
else
{
return "";
}
}
set
{
HttpContext.Current.Session["ConnStr"] = value;
}
}
}
}
|
|
|
|
|
The way you do it is overkill, and it's flawed.
You should pass the connection string to the constructor, get rid of the static keyword for the DBConnectionString property, add a private field _dbConnection and assign the value of it to the parameter you get in the constructor.
public class GetConnection
{
public GetConnection(string connectionStr)
{
_dbConnection = connectionStr;
}
private string _dbConnection;
public string DBConnectionString
{
get{return _dbConnection;}
}
}
}
It's still overkill.
Having a class with one string property that you set to something you already know.
As you have the connection string (hopefully stored in web.config), just fetch it from web.config everytime you want to connect into the database. In other words, don't keep the whole connection string in a session variable, but rather a key to fetch it by.
var question = (_2b || !(_2b));
|
|
|
|
|
The following are the test urls, i need to remove the "Admin" from the URL. So I want the regular expression to solve this issue
http://www.Admin.testsite.com/Administrator/Login.aspx
http://Admin.www.testsite.com/Administrator/Login.aspx
http://Admin.testsite.com/Administrator/Login.aspx
http://quality.Admin.testsite.com/Administrator/Login.aspx
Once we remove the "Admin" word or text from the above URL , output would be
http://www.testsite.com/Administrator/Login.aspx
http://www.testsite.com/Administrator/Login.aspx
http://testsite.com/Administrator/Login.aspx
http://quality.testsite.com/Administrator/Login.aspx
|
|
|
|
|
jayarajRaman wrote: So I want the regular expression to solve this issue
Try google, there are thousands of regex sites where you can try and test to your hearts content.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
i have implemented this code on the logout button
FormsAuthentication.SignOut();
Session.Abandon();
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "no-cache";
Response.Redirect("~/frm_default.aspx");
but when i click on back button i am able to go the previous page.
|
|
|
|
|
i think u have to add Headers to restrict Back view
Try this
Response.CacheControl = "no-store";
Response.AddHeader("Pragma", "no-cache");
Response.AppendHeader("Cache-Control", "no-store");
|
|
|
|
|
if u r using master pages, code this in page load of master page or in page load of everypage
Response.Expires = 60;
DateTime now = DateTime.Now.AddMilliseconds(-1);
Response.ExpiresAbsolute = now;
Response.AddHeader("pragma", "no-cache");
int timeout = (Session.Timeout + 1) * 60;
Response.AddHeader("Refresh", timeout.ToString());
Response.AddHeader("cache-control", "private");
Response.CacheControl = "no-cache";
if (Session.IsNewSession)
{
Response.Redirect("~/Default.aspx");
}
and in logout
Session.Abandon();
|
|
|
|
|
This is fine but then when i am on a page (not logged out) and then i click back button it does not take me to the previuos page. ihave to click refresh to get the page.
|
|
|
|
|
browser cache always remains open..
you cant erase bowser cache programmatically.
Only you can do, is when user clicks anything on a page after logoff, throw some error messages.
|
|
|
|
|
Hi,
On the Page Load write
if Session("UserId")="" then
Response.Redirect("Login.aspx")
end if
if you click back now, the page will execute the page load na...it will go to login page.
Ramesh Sambari
|
|
|
|
|
Hello friends
i am having a little issue hope anyone can help me out.
i have a situation my masterpage location changes due to some security requirements, so i am storing Foldername in Web.Config in AppSetting
like this --> add key="adminFolder" value="~/Temp/"
e.g
so i dont need to change everywhere when i have to update the foldername and getting back in Page Load event.
String adminFolder = System.Configuration.ConfigurationManager.AppSettings["adminFolder"];
protected void Page_PreInit(Object sender, EventArgs e)
{
this.MasterPageFile = adminFolder + "MasterPage.master";
}
this approach help me out to solve dynamically assign the foldername of master page
but i cant see Design View of my Code because i dont know how cant i link "adminFolder" Key in the Top of aspx file
|
|
|
|
|
hiii,
I am having a small doubt regarding the querystring ....
In my application there is a form with two pages..
I like to edit the details within the form for this i used a gridview
and querystring....taking the id value in the querystring i got the
details for the first page....
i kept edit&continue button at last which will redirect the page to
second page....
how to get the details in the second page basing on the id value
which we took in the first page....
how to write the querystring plz help me....
|
|
|
|
|
hi
You get query string value like this
String str=REquest.querystring("id")
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
hi
Code behind:
Dim dgitem As DataGridItem
For Each dgitem In Dgdisplay.Items
If cacheRankingName = "cumulativeranking" Then
'If dgitem.ItemType.Item = ListItemType.Header Or dgitem.ItemType.Item = ListItemType.AlternatingItem Or dgitem.ItemType.Item = ListItemType.Item Then
Dim dt As New DataTable
qrytoExecute = "select playerid, firstname , lastname, scores.points as leaderboarddisplay from scores " & qrytoAdd
qrytoExecute &= "group by scores.playerid order by leaderboarddisplay desc, playerid limit 30 "
dt = DBManager.GetDataTable(qrytoExecute)
For i = 0 To dt.Rows.Count - 1
Dim id As String = dt.Rows(i)("playerid").ToString()
Dim Query As String = "select concat(p.firstname,p.lastname) as Name from player p join scores s on s.playerid=p.userid where s.playerid=" & id
Dim retVal = DBManager.GetScalar1(Query)
Dim lbl As Label
Dim intCounter As New Integer
Dim str As String = DirectCast(dgitem.Cells(0).Controls(0), Label).Text
'If txtHNGet.Text = retVal Then
' 'flag = True
' dgitem.Cells(1).BackColor = System.Drawing.Color.DarkRed
'End If
Next
End If
'End If
Exit For
Next
End If
Html:
<asp:datagrid id="Dgdisplay" EnableViewState="False" Runat="server" PageSize="50" GridLines="None"
AutoGenerateColumns="False" Width="65%" AllowPaging="True">
<Columns>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Rank">
<ItemTemplate>
<asp:Label ID="lblrank" Runat="server">
<%#getRank%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Playername">
<ItemTemplate>
<a href='DisplayPlayerBioData.aspx?ids=<%#Container.DataItem("playerid")%>'>
<%#getPlayerName(Container.DataItem("firstname"),Container.DataItem("lastname"))%>
</a>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Count#">
<ItemTemplate>
<asp:Label ID="lblcount" Runat="server">
<%#DataBinder.Eval(Container.DataItem,"leaderboarddisplay")%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn Visible="False">
<ItemTemplate>
<asp:Label ID="lbl1" Runat="server">
<%#getPlayerName(Container.DataItem("firstname"),Container.DataItem("lastname"))%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Mode="NumericPages" ForeColor="#003300" PageButtonCount="2" HorizontalAlign="Right"
VerticalAlign="Top" Font-Bold="True"></PagerStyle>
</asp:datagrid>
i need to get datagrid cell value in codebehind..
here
Dim str As String = DirectCast(dgitem.Cells(0).Controls(0), Label).Text
//error displayed Specified cast is not valid.
Datagrid contain in webusercontrol
how can i get cell value...
Known Is Drop.Unknown Is Ocean
|
|
|
|