|
Thanks alot for your help ..
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hello,
I have an Access database with 2 tables: News and News_Localized.
Table "News" has 2 fields "Article_Id" and "Article_Date". "Article_Id" is the primary key. Both fields hold information which doesn't change with culture.
Table "News_Localized" has 4 fields "Article_Id", "Article_Culture", "Article_Title" and "Article_Text".
Basically, I want to load a record which should include the "Article_Date" and the fields "Article_Title and "Article_Text" for a given Article_Culture.
How can I do this?
Should I relate the 2 tables in someway?
What should be the SQL string in my VB.Net code?
Thanks,
Miguel
|
|
|
|
|
Join the tables in the query. Example:
select n.Article_Date, l.Article_Title, l.Article_Text<br />
from News n<br />
inner join News_Localized l on l.ArticleId = n.ArticleId<br />
where n.ArticleId = @ArticleId and l.Article_Culture = @Culture
---
b { font-weight: normal; }
|
|
|
|
|
select
n.Article_Date,nl.Article_Title,nl.Article_Text
from News n, News_Localized nl
where nl.Article_Id = n.Article_Id and
nl.Article_Culture = <selected culture="" here="">"
|
|
|
|
|
Hello All,
I migrated from 1.1 to 2.0 and the DataGrids on WebPages are giving me error in the sense is it firing the Events(ItemCommand,ItemCreated etc) twice.
It was working fine with ASP.NET 1.1....Am I missing some attribute or Property that i will have to Add if I am using DataGrid in 2.0 ( as it is replaced by GridView in 2.0 )?
Has anyone experienced the same before?
Any Suggestions will be most appreciated.
Thanks.
|
|
|
|
|
Still haven't found the solution....Can Anyone suggest something??
Thanks
|
|
|
|
|
How can i send gridview within mail in asp.net
i tried get content of div[runat="server"] which has gridview
but error occurs ("Cannot get inner content of divmail because the contents are not literal.")
how can i achive that,
thanks in advance..
|
|
|
|
|
not sure of current .net support, but i did this a while ago and acheived it by creating an HTML table from iterating the datasource then sending the table as the email.
regards,
g00fy
|
|
|
|
|
I am fairly new to ASP.NET 2.0 and I am able to load a web page up with a report viewer showing 1 .rdlc file. I noticed that there is no print option available on the toolbar but in my reportviewer properties I have "ShowPrintButton" set to true?
Chris
|
|
|
|
|
If you use reportViewer with LocalReport (no MSSQL Reporting services support), then you can't print your reports directly. It is because print functionality uses ActiveX component, which request print information from reporting services server. If you are in local mode, there is no server to ask for this information.
Pilo
|
|
|
|
|
I guess there is no way to pass the local printer information to the reportviewer manually?
Chris
|
|
|
|
|
Hello,
Is it possible to redefine the URL of a page using culture information.
For example, for the URL http://www.domain.com/contacts.aspx:
Culture pt-PT: http://www.domain.com/contactos
Culture en-GB: http://www.domain.com/contacts
I am using Asp.Net 2.0.
Thanks,
Miguel
|
|
|
|
|
|
Hello friends
I have a TreeView populated with a SiteMapDataSource. I wish show leaf nodes on click in the parent node and not in the plus icon. I wish what the parent menu item clicked will not navigate to another page, but expand/collapse the child leaf nodes.
How I perform this?
Kindly Regards
Jesus is Love! Tell to someone!
|
|
|
|
|
you will need to trap the TreeView1_TreeNodeDataBound
something like this should do it
protected void TreeView1_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{
if (e.Node.Parent == null)
{
e.Node.NavigateUrl = string.Empty;
e.Node.SelectAction = TreeNodeSelectAction.Expand;
}
}
regards,
g00fy
|
|
|
|
|
Hello,
I have been using the Asp.Net 2.0 resource files to save information on various languages.
The problem is that I need to save some information on a database.
Consider a "News" database with the follwing fields: [news_id], [news_title], [news_text] and [news_date].
What I need is for a record to have various news_title and news_text for all languages.
The [news_id] and [news_date] will be common to all languages.
How should I build my database?
Should I have more then one table?
I am using Asp.Net 2.0 and Microsoft Access.
Thanks,
Miguel
|
|
|
|
|
Create a table for the title and text using a combined key consisting of the ID and a column identifying the language. A simple join can now retreive the title and text of a specific news id and language.
|
|
|
|
|
in my login page i have folliwing code:
if Session("UserRole") = "Admin" then
Response.redirect("http://kicakhist/MySite/Admin")
else
Response.redirect("http://kicakhist/MySite")
End if
but this doesnt work. even when i login using admin id and password, i get redirected to home page instead of admin page. why is it?
|
|
|
|
|
I don't work with VB.NET, but if I should apply C# approach, then Session("UserRole") is object, while "Admin" is string. If you compare object with string, then references are compared, and they are different of course. You should do following comparison:
if Session("UserRole").ToString() = "Admin" ...
Pilo
|
|
|
|
|
thank you for you reply. i tried what u suggested but still it doesnt work
|
|
|
|
|
now its working. i used Trim and also used ToString too.
if Trim(Session("UserRole")).ToString = "Admin" then
Response.redirect("http://kicakhist/MySite/Admin")
else
Response.redirect("http://kicakhist/MySite")
End if
thanks you for trying to help
|
|
|
|
|
It means that you store to a session string like " Admin" instead of "Admin".
I'll give you an advice, store objects to session exactly as they should be there rather then correct stored value after retrieving. You will save yourself lots of trouble later (like the one you just solved )
|
|
|
|
|
Hi All,
I have created a custom provider for Membership for sql 2000 and am using the Login control on a page called Login.aspx. I have set the name of the cookie in web.config to ".C8AAUTH". I have the DisplayRememberMe set to True so that it appears on the login control. I authenticate using my username and password and it will then allow me access to restricted pages on the site. If close the browser and then re-open it again, User.Identity.IsAuthenticated will return True as expected.
The trouble is that if I close the browser, then come back half an hour later, User.Identity.IsAuthenticated will return False and I will be redirected to the login page. Logging in with the 'Remember Me' checkbox checked is supposed to write a persistent cookie, but in my case it doesn't appear to be doing this.
Can anyone shed any light on this please?
Many thanks,
Martin
|
|
|
|
|
not only does my login control keeps ignoring me, but everyone at Codeproject is too. Nobody loves me. Didn't want to use the stupid login control anyway.
I think I will just go and get a job as a waiter or something.
Boo Hoo.
|
|
|
|
|
Nobody is ignoring you; just we have problems to solve too,
Check and translate this solution
The Login Control name is Logeo
On LoggedIn
protected void Logeo_LoggedIn(object sender, EventArgs e)
{
/*Si el campo Recordarme en este equipo esta activo se guarda
el coopkie en el equipo del cliente*/
CheckBox chBox = (CheckBox)Logeo.FindControl("RememberMe");
if (chBox.Checked)
{
HttpCookie FmmbCookie = new HttpCookie("FmmbCookie");
Response.Cookies.Remove("FmmbCookie");
Response.Cookies.Add(FmmbCookie);
FmmbCookie.Values.Add("usuario", this.Logeo.UserName);
DateTime fechaExpiracion = DateTime.Now.AddDays(15);
//Al cookie se le asigno un periodo de vida de 15 días
Response.Cookies["FmmbCookie"].Expires = fechaExpiracion;
}
}
Everytime the user logged in, these lines write a persistent cookie over the client browsers (15 days live),just write the user name
On Page load you must to check if the visitor browser have the cookie.
In true case write the user name onto login control username.
protected void Page_Load(object sender, EventArgs e)
{
La_Fecha.Text = System.DateTime.Now.ToLongDateString();
if (!IsPostBack)//Se ejecuta cuando se carga por primera vez
{
//Verifica si el cliente tiene cookie activo
if (Request.Cookies["FmmbCookie"] != null)
{
HttpCookie cookie = Request.Cookies.Get("FmmbCookie");
string usuario = cookie.Values["usuario"].ToString();
if (usuario != "")
{
Logeo.UserName = usuario;
}
}
}
}
You can do the same with the password if you want.
keep Learning and you never will be out of date...
|
|
|
|