ceyda
ceyda
KPCKevin Powell - Community
Created by ceyda on 5/16/2024 in #front-end
navbar sub-menu doesn't function properly
I'm working on a website and in hizmetler.php page I have three section (2nd photo). When I click a title in that menu, the div related to that title shows and other divs hide. I want to add the same function to the sub-menu in navbar (1st photo). If I'm in hizmetler.php page, the navbar sub-menu works. But if I am another page when i click a title in that menu it takes me to hizmetler.php but to the default not the related div. And when I try to go there from index.php it doesn't go to even hizmetler.php. I am not that good at javascript/jquery so any help would be really appreciated. This is navbar code:
<header>
<a href="index.php" class="logo">
<img src="assets/img/logo.png" alt="logo" height="50">
</a>

<input type="checkbox" id="menu-bar">
<label for="menu-bar">Menü</label>

<nav class="navbar">
<ul>
<li><a href="hizmetler.php">HİZMETLERİMİZ</a>
<ul>
<li><a href="hizmetler.php" class="service-title" data-target="#section-one">ÇATI</a></li>
<li><a href="hizmetler.php" class="service-title" data-target="#section-two">ÇELİK</a></li>
<li><a href="hizmetler.php" class="service-title" data-target="#section-three">DİĞER</a></li>
</ul>
</li>
<li><a href="#">REFERANSLARIMIZ</a></li>
<li><a href="#">GALERİ</a></li>
<li><a href="iletisim.php">İLETİŞİM</a></li>
</ul>
</nav>
</header>
<header>
<a href="index.php" class="logo">
<img src="assets/img/logo.png" alt="logo" height="50">
</a>

<input type="checkbox" id="menu-bar">
<label for="menu-bar">Menü</label>

<nav class="navbar">
<ul>
<li><a href="hizmetler.php">HİZMETLERİMİZ</a>
<ul>
<li><a href="hizmetler.php" class="service-title" data-target="#section-one">ÇATI</a></li>
<li><a href="hizmetler.php" class="service-title" data-target="#section-two">ÇELİK</a></li>
<li><a href="hizmetler.php" class="service-title" data-target="#section-three">DİĞER</a></li>
</ul>
</li>
<li><a href="#">REFERANSLARIMIZ</a></li>
<li><a href="#">GALERİ</a></li>
<li><a href="iletisim.php">İLETİŞİM</a></li>
</ul>
</nav>
</header>
2 replies
KPCKevin Powell - Community
Created by ceyda on 2/15/2024 in #front-end
How can i keep the value of a textbox after postback
I am not sure if i should ask this in front-end or back-end. But here it goes: I am developing a website using asp.net and c#. I have a section where i can see the feedbacks in a html table. And every row has three actions: auto-respond, respond and delete. Auto-respond and delete actions work and for respond, there is a problem. If i choose respond (Cevapla) (which is for custom respond) a section becomes visible. In that section there are three textboxes and two buttons. I set the value of TextBox1 by using a js function which takes the value of selected row's second column (email address). Other two are for subject and message. One button is html button for cancel. The other one is an asp button for send email. The problem is when i click send button the page loads again (AutoPostBack) and the value of TextBox1 (which i get from js function) becomes "". How can i keep the value of TextBox1 after postback? Frontend code is attached. Website's language is Turkish and i translate some content to english (such as buttons in question) but if there is a part needs translating please tell me. And for backend i have a Button_Click:
protected void Button1_Click(object sender, EventArgs e)
{
string alici = Request.Form["alici"];
string baslik = Request.Form["baslik"];
string mesaj = Request.Form["mesaj"];

Email email = new Email();
email.cevapla(alici, baslik, mesaj);
gonderildi.Visible = true;
}
protected void Button1_Click(object sender, EventArgs e)
{
string alici = Request.Form["alici"];
string baslik = Request.Form["baslik"];
string mesaj = Request.Form["mesaj"];

Email email = new Email();
email.cevapla(alici, baslik, mesaj);
gonderildi.Visible = true;
}
Thank you
2 replies
KPCKevin Powell - Community
Created by ceyda on 6/30/2023 in #front-end
Grid in Chrome vs Firefox
3 replies