bohužel ano a ještě je zajímavé ža když jsem tam ještě někam přidal komponentu label a v události onclick jsem jí dodal text a taky se nezobrazila :( dám sem celý kód je podlemě docela prasecky napsaný tak že by mohla být chyba i v tom
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Request.QueryString("Id") <> Nothing Then
labe1.Text = ""
Label1.Visible = True
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("GrrConnectionString").ConnectionString)
Dim PostCom As New SqlCommand("SELECT * FROM [Posts] WHERE [Id]=@Id", con)
PostCom.Parameters.AddWithValue("Id", Request.QueryString("Id"))
con.Open()
Dim TopicReader As SqlDataReader = PostCom.ExecuteReader()
TopicReader.Read()
Label2.Text = String.Format("|| <strong>Autor :</strong> {0} || <strong>Datum :</strong> {1:D} || ", TopicReader("Autor"), TopicReader("Cas"))
Dim Autor As String = TopicReader("Autor").ToString.ToLower()
TopicReader.Close()
con.Close()
Dim com As New SqlCommand("select [Text] from [Posts] where [Id]=@IdArticle", con)
com.Parameters.AddWithValue("IdArticle", Request.QueryString("Id"))
con.Open()
labe2.Text = com.ExecuteScalar().ToString()
con.Close()
If User.IsInRole("Admin") Or User.IsInRole("Administrator") Or User.Identity.Name.ToLower() = Autor Then
Label3.Visible = True
HyperLink1.NavigateUrl = String.Format("~/Account/Post.aspx?Id={0}", Request.QueryString("Id"))
End If
End If
End Sub
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("GrrConnectionString").ConnectionString)
Dim PostCom As New SqlCommand("DELETE FROM [Posts] WHERE [Id]=@Id", con)
PostCom.Parameters.AddWithValue("Id", Request.QueryString("Id"))
con.Open()
PostCom.ExecuteNonQuery()
labe1.Visible = True
labe1.Text = "tak cooo :???"
con.Close()
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h1><asp:SiteMapPath ID="SiteMapPath1" runat="server" ParentLevelsDisplayed="1" PathSeparator=" - " />
<asp:Label ID="labe1" runat="server" Text="Výtej na Grr webu"/></h1>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:Label ID="labe2" runat="server" Text="Vítejte na mém webu určném pro všechny, kteří mají rádi ASP.NEt PHP a FLASH." />
<asp:Label ID="Label1" runat="server" visible="false" Text="">
<div id="Information">
<div id="Inf_inner_img">
<asp:Image ID="Image1" runat="server" ImageUrl="App_Themes/Default/image/Head.png" Width="70" Height="80" />
</div>
<div id="Inf_inner_text" >
<asp:Label ID="Label2" runat="server"></asp:Label>
<asp:Label ID="Label3" runat="server" visible="false" Text="">
<asp:HyperLink ID="HyperLink1" runat="server">Upravit</asp:HyperLink>
||
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">Smazat</asp:LinkButton>
</asp:Label>
</div>
</div>
</asp:Label>
</asp:Content>
|